diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9c5297afae4..3a3429bffb8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -30,6 +30,8 @@ /src/dnc/ @alegal +/src/dns-resolver/ @necusjz + /src/edgeorder/ @necusjz /src/express-route-cross-connection/ @necusjz @kairu-ms @jsntcy diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index f1efcc2f1ab..f966306337c 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,9 @@ - If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at [Azure/azure-cli](https://github.com/Azure/azure-cli/issues) +### Related command + + + ### Extension name (the extension in question) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index db2d215c6d2..23212cc5bb4 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,6 +2,10 @@ This checklist is used to make sure that common guidelines for a pull request are followed. +### Related command + + + ### General Guidelines - [ ] Have you run `azdev style ` locally? (`pip install azdev` required) diff --git a/linter_exclusions.yml b/linter_exclusions.yml index 049c09aba9f..7b4b61ab11d 100644 --- a/linter_exclusions.yml +++ b/linter_exclusions.yml @@ -205,6 +205,22 @@ arcdata dc create: metrics_ui_public_key_file: rule_exclusions: - option_length_too_long +arcdata ad-connector create: + parameters: + domain_service_account_secret: + rule_exclusions: + - option_length_too_long + secondary_domain_controllers: + rule_exclusions: + - option_length_too_long +arcdata ad-connector update: + parameters: + domain_service_account_secret: + rule_exclusions: + - option_length_too_long + secondary_domain_controllers: + rule_exclusions: + - option_length_too_long sql mi-arc update: parameters: preferred_primary_replica: diff --git a/src/aks-preview/HISTORY.md b/src/aks-preview/HISTORY.md index 5ac5d775625..ff67370d709 100644 --- a/src/aks-preview/HISTORY.md +++ b/src/aks-preview/HISTORY.md @@ -3,6 +3,10 @@ Release History =============== +0.5.66 +++++++ +* Prompt when no arguments are given to update and nodepool update to see if the customer wants to try goal seek to current settings. + 0.5.65 ++++++ * Add `--ignore-pod-disruption-budget` flag for `az aks nodepool delete` for ignoring PodDisruptionBudget. diff --git a/src/aks-preview/azcli_aks_live_test/configs/ext_matrix_default.json b/src/aks-preview/azcli_aks_live_test/configs/ext_matrix_default.json index 425b1c5af84..96f17666206 100644 --- a/src/aks-preview/azcli_aks_live_test/configs/ext_matrix_default.json +++ b/src/aks-preview/azcli_aks_live_test/configs/ext_matrix_default.json @@ -24,7 +24,8 @@ "test_aks_nodepool_add_with_gpu_instance_profile", "test_aks_create_with_crg_id", "test_aks_create_and_update_with_http_proxy_config", - "test_aks_snapshot" + "test_aks_snapshot", + "test_aks_custom_kubelet_identity" ] } } \ No newline at end of file diff --git a/src/aks-preview/azext_aks_preview/_client_factory.py b/src/aks-preview/azext_aks_preview/_client_factory.py index 6eb8fe35d44..a39b2994e30 100644 --- a/src/aks-preview/azext_aks_preview/_client_factory.py +++ b/src/aks-preview/azext_aks_preview/_client_factory.py @@ -14,48 +14,46 @@ 'ContainerServiceClient') -def cf_storage(cli_ctx, subscription_id=None): - return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_STORAGE, subscription_id=subscription_id) - - -def cf_compute_service(cli_ctx, *_): - return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_COMPUTE) +def get_container_service_client(cli_ctx, **_): + return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW) def cf_container_services(cli_ctx, *_): return get_container_service_client(cli_ctx).container_services -def get_container_service_client(cli_ctx, **_): - return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW) - - def cf_managed_clusters(cli_ctx, *_): - return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW).managed_clusters + return get_container_service_client(cli_ctx).managed_clusters def cf_agent_pools(cli_ctx, *_): - return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW).agent_pools + return get_container_service_client(cli_ctx).agent_pools -def cf_mc_snapshots_client(cli_ctx, subscription_id=None): - return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW, subscription_id=subscription_id).managed_cluster_snapshots +def cf_maintenance_configurations(cli_ctx, *_): + return get_container_service_client(cli_ctx).maintenance_configurations -def cf_mc_snapshots(cli_ctx, *_): - return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW).managed_cluster_snapshots +def cf_nodepool_snapshots(cli_ctx, *_): + return get_container_service_client(cli_ctx).snapshots +# TODO: remove this def cf_nodepool_snapshots_client(cli_ctx, subscription_id=None): return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW, subscription_id=subscription_id).snapshots -def cf_nodepool_snapshots(cli_ctx, *_): - return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW).snapshots +def cf_mc_snapshots(cli_ctx, *_): + return get_container_service_client(cli_ctx).managed_cluster_snapshots -def cf_maintenance_configurations(cli_ctx, *_): - return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW).maintenance_configurations +# TODO: remove this +def cf_mc_snapshots_client(cli_ctx, subscription_id=None): + return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW, subscription_id=subscription_id).managed_cluster_snapshots + + +def cf_compute_service(cli_ctx, *_): + return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_COMPUTE) def cf_resource_groups(cli_ctx, subscription_id=None): @@ -73,6 +71,10 @@ def cf_container_registry_service(cli_ctx, subscription_id=None): subscription_id=subscription_id) +def cf_storage(cli_ctx, subscription_id=None): + return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_STORAGE, subscription_id=subscription_id) + + def get_auth_management_client(cli_ctx, scope=None, **_): import re diff --git a/src/aks-preview/azext_aks_preview/_help.py b/src/aks-preview/azext_aks_preview/_help.py index fa00f0c8f81..e0b2dbba06a 100644 --- a/src/aks-preview/azext_aks_preview/_help.py +++ b/src/aks-preview/azext_aks_preview/_help.py @@ -30,6 +30,9 @@ type: bool short-summary: Skip role assignment for subnet (advanced networking). long-summary: If specified, please make sure your service principal has the access to your subnet. + - name: --zones -z + type: string array + short-summary: Space-separated list of availability zones where agent nodes will be placed. - name: --client-secret type: string short-summary: Secret associated with the service principal. This argument is required if @@ -517,7 +520,8 @@ helps['aks update'] = """ type: command - short-summary: Update a managed Kubernetes cluster properties, such as enable/disable cluster-autoscaler + short-summary: Update the properties of a managed Kubernetes cluster. + long-summary: Update the properties of a managed Kubernetes cluster. Can be used for example to enable/disable cluster-autoscaler. When called with no optional arguments this attempts to move the cluster to its goal state without changing the current cluster configuration. This can be used to move out of a non succeeded state. parameters: - name: --enable-cluster-autoscaler -e type: bool @@ -707,6 +711,8 @@ type: string short-summary: Identifier of Azure Key Vault key. examples: + - name: Reconcile the cluster back to its current state. + text: az aks update -g MyResourceGroup -n MyManagedCluster - name: Enable cluster-autoscaler within node count range [1,5] text: az aks update --enable-cluster-autoscaler --min-count 1 --max-count 5 -g MyResourceGroup -n MyManagedCluster - name: Disable cluster-autoscaler for an existing cluster @@ -990,9 +996,9 @@ type: int short-summary: The maximum number of pods deployable to a node. long-summary: If not specified, defaults based on network-plugin. 30 for "azure", 110 for "kubenet", or 250 for "none". - - name: --node-zones --zones -z + - name: --zones -z type: string array - short-summary: (will be deprecated, use --zones) Availability zones where agent nodes will be placed. + short-summary: Space-separated list of availability zones where agent nodes will be placed. - name: --vnet-subnet-id type: string short-summary: The ID of a subnet in an existing VNet into which to deploy the cluster. @@ -1132,7 +1138,8 @@ helps['aks nodepool update'] = """ type: command - short-summary: Update a node pool to enable/disable cluster-autoscaler or change min-count or max-count + short-summary: Update a node pool properties. + long-summary: Update a node pool to enable/disable cluster-autoscaler or change min-count or max-count. When called with no optional arguments this attempts to move the cluster to its goal state without changing the current cluster configuration. This can be used to move out of a non succeeded state. parameters: - name: --enable-cluster-autoscaler -e type: bool @@ -1165,6 +1172,8 @@ type: string short-summary: The node taints for the node pool. examples: + - name: Reconcile the nodepool back to its current state. + text: az aks nodepool update -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster - name: Enable cluster-autoscaler within node count range [1,5] text: az aks nodepool update --enable-cluster-autoscaler --min-count 1 --max-count 5 -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster - name: Disable cluster-autoscaler for an existing cluster diff --git a/src/aks-preview/azext_aks_preview/_helpers.py b/src/aks-preview/azext_aks_preview/_helpers.py index de46221daff..c21f9c8e4dd 100644 --- a/src/aks-preview/azext_aks_preview/_helpers.py +++ b/src/aks-preview/azext_aks_preview/_helpers.py @@ -2,7 +2,14 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from ._consts import CONST_CONTAINER_NAME_MAX_LENGTH +import re + +from azure.cli.command_modules.acs._helpers import map_azure_error_to_cli_error +from azure.cli.core.azclierror import InvalidArgumentValueError, ResourceNotFoundError +from azure.core.exceptions import AzureError + +from azext_aks_preview._client_factory import cf_nodepool_snapshots +from azext_aks_preview._consts import CONST_CONTAINER_NAME_MAX_LENGTH def _trim_fqdn_name_containing_hcp(normalized_fqdn: str) -> str: @@ -65,3 +72,29 @@ def similar_word(a, b): matches.append(word) return matches + + +def get_nodepool_snapshot_by_snapshot_id(cli_ctx, snapshot_id): + _re_snapshot_resource_id = re.compile( + r"/subscriptions/(.*?)/resourcegroups/(.*?)/providers/microsoft.containerservice/snapshots/(.*)", + flags=re.IGNORECASE, + ) + snapshot_id = snapshot_id.lower() + match = _re_snapshot_resource_id.search(snapshot_id) + if match: + resource_group_name = match.group(2) + snapshot_name = match.group(3) + return get_nodepool_snapshot(cli_ctx, resource_group_name, snapshot_name) + raise InvalidArgumentValueError("Cannot parse snapshot name from provided resource id '{}'.".format(snapshot_id)) + + +def get_nodepool_snapshot(cli_ctx, resource_group_name, snapshot_name): + snapshot_client = cf_nodepool_snapshots(cli_ctx) + try: + snapshot = snapshot_client.get(resource_group_name, snapshot_name) + # track 2 sdk raise exception from azure.core.exceptions + except AzureError as ex: + if "not found" in ex.message: + raise ResourceNotFoundError("Snapshot '{}' not found.".format(snapshot_name)) + raise map_azure_error_to_cli_error(ex) + return snapshot diff --git a/src/aks-preview/azext_aks_preview/_params.py b/src/aks-preview/azext_aks_preview/_params.py index d77213f7f8b..6b6ca8008b1 100644 --- a/src/aks-preview/azext_aks_preview/_params.py +++ b/src/aks-preview/azext_aks_preview/_params.py @@ -174,10 +174,8 @@ def load_arguments(self, _): c.argument('enable_rbac', action='store_true', options_list=['--enable-rbac', '-r'], deprecate_info=c.deprecate(redirect="--disable-rbac", hide="2.0.45")) c.argument('edge_zone', edge_zone_type) - c.argument('admin_username', options_list=[ - '--admin-username', '-u'], default='azureuser') - c.argument('generate_ssh_keys', action='store_true', - validator=validate_create_parameters) + c.argument('admin_username', options_list=['--admin-username', '-u'], default='azureuser') + c.argument('generate_ssh_keys', action='store_true', validator=validate_create_parameters) c.argument('ssh_key_value', required=False, type=file_type, default=os.path.join('~', '.ssh', 'id_rsa.pub'), completer=FilesCompleter(), validator=validate_ssh_key) c.argument('no_ssh_key', options_list=['--no-ssh-key', '-x']) @@ -185,22 +183,15 @@ def load_arguments(self, _): c.argument('docker_bridge_address') c.argument('pod_cidrs') c.argument('service_cidrs') - c.argument('load_balancer_sku', arg_type=get_enum_type(load_balancer_skus), - validator=validate_load_balancer_sku) + c.argument('load_balancer_sku', arg_type=get_enum_type(load_balancer_skus), validator=validate_load_balancer_sku) c.argument('load_balancer_managed_outbound_ip_count', type=int) c.argument('load_balancer_managed_outbound_ipv6_count', type=int) - c.argument('load_balancer_outbound_ips', type=str, - validator=validate_load_balancer_outbound_ips) - c.argument('load_balancer_outbound_ip_prefixes', type=str, - validator=validate_load_balancer_outbound_ip_prefixes) - c.argument('load_balancer_outbound_ports', type=int, - validator=validate_load_balancer_outbound_ports) - c.argument('load_balancer_idle_timeout', type=int, - validator=validate_load_balancer_idle_timeout) - c.argument('nat_gateway_managed_outbound_ip_count', type=int, - validator=validate_nat_gateway_managed_outbound_ip_count) - c.argument('nat_gateway_idle_timeout', type=int, - validator=validate_nat_gateway_idle_timeout) + c.argument('load_balancer_outbound_ips', validator=validate_load_balancer_outbound_ips) + c.argument('load_balancer_outbound_ip_prefixes', validator=validate_load_balancer_outbound_ip_prefixes) + c.argument('load_balancer_outbound_ports', type=int, validator=validate_load_balancer_outbound_ports) + c.argument('load_balancer_idle_timeout', type=int, validator=validate_load_balancer_idle_timeout) + c.argument('nat_gateway_managed_outbound_ip_count', type=int, validator=validate_nat_gateway_managed_outbound_ip_count) + c.argument('nat_gateway_idle_timeout', type=int, validator=validate_nat_gateway_idle_timeout) c.argument('outbound_type', arg_type=get_enum_type(outbound_types)) c.argument('network_plugin', arg_type=get_enum_type(network_plugins)) c.argument('network_policy') @@ -208,18 +199,15 @@ def load_arguments(self, _): c.argument('cluster_autoscaler_profile', nargs='+') c.argument('uptime_sla', action='store_true') c.argument('fqdn_subdomain') - c.argument('api_server_authorized_ip_ranges', - type=str, validator=validate_ip_ranges) + c.argument('api_server_authorized_ip_ranges', validator=validate_ip_ranges) c.argument('enable_private_cluster', action='store_true') c.argument('private_dns_zone') c.argument('disable_public_fqdn', action='store_true') c.argument('service_principal') c.argument('client_secret') c.argument('enable_managed_identity', action='store_true') - c.argument('assign_identity', type=str, - validator=validate_assign_identity) - c.argument('assign_kubelet_identity', type=str, - validator=validate_assign_kubelet_identity) + c.argument('assign_identity', validator=validate_assign_identity) + c.argument('assign_kubelet_identity', validator=validate_assign_kubelet_identity) c.argument('enable_aad', action='store_true') c.argument('enable_azure_rbac', action='store_true') c.argument('aad_client_app_id') @@ -227,55 +215,41 @@ def load_arguments(self, _): c.argument('aad_server_app_secret') c.argument('aad_tenant_id') c.argument('aad_admin_group_object_ids') - c.argument('windows_admin_username', options_list=[ - '--windows-admin-username']) - c.argument('windows_admin_password', options_list=[ - '--windows-admin-password']) - c.argument('enable_ahub', options_list=['--enable-ahub']) - c.argument('disable_ahub', options_list=['--disable-ahub']) - c.argument('gmsa_dns_server', options_list=['--gmsa-dns-server']) - c.argument('gmsa_root_domain_name', options_list=[ - '--gmsa-root-domain-name']) + c.argument('windows_admin_username') + c.argument('windows_admin_password') + c.argument('enable_ahub') + c.argument('disable_ahub') + c.argument('gmsa_dns_server') + c.argument('gmsa_root_domain_name') c.argument('attach_acr', acr_arg_type) c.argument('skip_subnet_role_assignment', action='store_true') # addons - c.argument('enable_addons', options_list=[ - '--enable-addons', '-a'], validator=validate_addons) + c.argument('enable_addons', options_list=['--enable-addons', '-a'], validator=validate_addons) c.argument('workspace_resource_id') - c.argument('enable_msi_auth_for_monitoring', - arg_type=get_three_state_flag(), is_preview=True) - c.argument('aci_subnet_name', type=str) - c.argument('appgw_name', options_list=[ - '--appgw-name'], arg_group='Application Gateway') - c.argument('appgw_subnet_prefix', options_list=[ - '--appgw-subnet-prefix'], arg_group='Application Gateway', deprecate_info=c.deprecate(redirect='--appgw-subnet-cidr', hide=True)) - c.argument('appgw_subnet_cidr', options_list=[ - '--appgw-subnet-cidr'], arg_group='Application Gateway') - c.argument('appgw_id', options_list=[ - '--appgw-id'], arg_group='Application Gateway') - c.argument('appgw_subnet_id', options_list=[ - '--appgw-subnet-id'], arg_group='Application Gateway') - c.argument('appgw_watch_namespace', options_list=[ - '--appgw-watch-namespace'], arg_group='Application Gateway') + c.argument('enable_msi_auth_for_monitoring', arg_type=get_three_state_flag(), is_preview=True) + c.argument('aci_subnet_name') + c.argument('appgw_name', arg_group='Application Gateway') + c.argument('appgw_subnet_prefix', arg_group='Application Gateway', deprecate_info=c.deprecate(redirect='--appgw-subnet-cidr', hide=True)) + c.argument('appgw_subnet_cidr', arg_group='Application Gateway') + c.argument('appgw_id', arg_group='Application Gateway') + c.argument('appgw_subnet_id', arg_group='Application Gateway') + c.argument('appgw_watch_namespace', arg_group='Application Gateway') c.argument('enable_secret_rotation', action='store_true') - c.argument('rotation_poll_interval', type=str) + c.argument('rotation_poll_interval') c.argument('enable_sgxquotehelper', action='store_true') # nodepool paramerters - c.argument('nodepool_name', type=str, default='nodepool1', + c.argument('nodepool_name', default='nodepool1', help='Node pool name, upto 12 alphanumeric characters', validator=validate_nodepool_name) c.argument('node_vm_size', options_list=[ '--node-vm-size', '-s'], completer=get_vm_size_completion_list) - c.argument('os_sku', type=str, options_list=[ - '--os-sku'], completer=get_ossku_completion_list) - c.argument('vnet_subnet_id', type=str, - validator=validate_vnet_subnet_id) - c.argument('pod_subnet_id', type=str, validator=validate_pod_subnet_id) + c.argument('os_sku', completer=get_ossku_completion_list) + c.argument('vnet_subnet_id', validator=validate_vnet_subnet_id) + c.argument('pod_subnet_id', validator=validate_pod_subnet_id) c.argument('enable_node_public_ip', action='store_true') - c.argument('node_public_ip_prefix_id', type=str) + c.argument('node_public_ip_prefix_id') c.argument('enable_cluster_autoscaler', action='store_true') c.argument('min_count', type=int, validator=validate_nodes_count) c.argument('max_count', type=int, validator=validate_nodes_count) - c.argument('nodepool_tags', nargs='*', validator=validate_nodepool_tags, help='space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.') c.argument('nodepool_labels', nargs='*', validator=validate_nodepool_labels, @@ -283,19 +257,17 @@ def load_arguments(self, _): c.argument('node_osdisk_type', arg_type=get_enum_type(node_os_disk_types)) c.argument('node_osdisk_size', type=int) c.argument('max_pods', type=int, options_list=['--max-pods', '-m']) - c.argument('vm_set_type', type=str, validator=validate_vm_set_type) - c.argument('enable_vmss', action='store_true', - help='To be deprecated. Use vm_set_type instead.') - c.argument('node_zones', zones_type, options_list=[ - '--node-zones', '--zones', '-z'], help='(--node-zones will be deprecated, use --zones) Space-separated list of availability zones where agent nodes will be placed.') + c.argument('vm_set_type', validator=validate_vm_set_type) + c.argument('enable_vmss', action='store_true', help='To be deprecated. Use vm_set_type instead.', deprecate_info=c.deprecate(redirect='--vm-set-type', hide=True)) + c.argument('node_zones', zones_type, options_list=['--node-zones'], help='(--node-zones will be deprecated) Space-separated list of availability zones where agent nodes will be placed.', deprecate_info=c.deprecate(redirect='--zones', hide='2.37.0')) + c.argument('zones', zones_type, options_list=['--zones', '-z'], help='Space-separated list of availability zones where agent nodes will be placed.') c.argument('ppg') - c.argument('enable_encryption_at_host', arg_type=get_three_state_flag( - ), help='Enable EncryptionAtHost.') + c.argument('enable_encryption_at_host', arg_type=get_three_state_flag(), help='Enable EncryptionAtHost.') c.argument('enable_ultra_ssd', action='store_true') c.argument('enable_fips_image', action='store_true') c.argument('snapshot_id', validator=validate_snapshot_id) - c.argument('kubelet_config', type=str) - c.argument('linux_os_config', type=str) + c.argument('kubelet_config') + c.argument('linux_os_config') c.argument('yes', options_list=[ '--yes', '-y'], help='Do not prompt for confirmation.', action='store_true') c.argument('aks_custom_headers') @@ -303,26 +275,20 @@ def load_arguments(self, _): # managed cluster c.argument('node_resource_group') c.argument('ip_families') - c.argument('http_proxy_config', options_list=[ - '--http-proxy-config'], type=str) + c.argument('http_proxy_config') c.argument('enable_pod_security_policy', action='store_true') c.argument('enable_pod_identity', action='store_true') c.argument('enable_workload_identity', arg_type=get_three_state_flag(), is_preview=True) c.argument('enable_oidc_issuer', action='store_true', is_preview=True) - c.argument('enable_azure_keyvault_kms', - action='store_true', is_preview=True) - c.argument('azure_keyvault_kms_key_id', - validator=validate_azure_keyvault_kms_key_id, is_preview=True) - c.argument('cluster_snapshot_id', - validator=validate_cluster_snapshot_id, is_preview=True) + c.argument('enable_azure_keyvault_kms', action='store_true', is_preview=True) + c.argument('azure_keyvault_kms_key_id', validator=validate_azure_keyvault_kms_key_id, is_preview=True) + c.argument('cluster_snapshot_id', validator=validate_cluster_snapshot_id, is_preview=True) # nodepool - c.argument('host_group_id', - validator=validate_host_group_id, is_preview=True) + c.argument('host_group_id', validator=validate_host_group_id, is_preview=True) c.argument('crg_id', validator=validate_crg_id, is_preview=True) # no validation for aks create because it already only supports Linux. - c.argument('message_of_the_day', type=str) - c.argument('gpu_instance_profile', - arg_type=get_enum_type(gpu_instance_profiles)) + c.argument('message_of_the_day') + c.argument('gpu_instance_profile', arg_type=get_enum_type(gpu_instance_profiles)) c.argument('workload_runtime', arg_type=get_enum_type(workload_runtimes), default=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER) with self.argument_context('aks update') as c: @@ -331,51 +297,39 @@ def load_arguments(self, _): c.argument('enable_local_accounts', action='store_true') c.argument('load_balancer_managed_outbound_ip_count', type=int) c.argument('load_balancer_managed_outbound_ipv6_count', type=int) - c.argument('load_balancer_outbound_ips', type=str, - validator=validate_load_balancer_outbound_ips) - c.argument('load_balancer_outbound_ip_prefixes', type=str, - validator=validate_load_balancer_outbound_ip_prefixes) - c.argument('load_balancer_outbound_ports', type=int, - validator=validate_load_balancer_outbound_ports) - c.argument('load_balancer_idle_timeout', type=int, - validator=validate_load_balancer_idle_timeout) - c.argument('nat_gateway_managed_outbound_ip_count', type=int, - validator=validate_nat_gateway_managed_outbound_ip_count) - c.argument('nat_gateway_idle_timeout', type=int, - validator=validate_nat_gateway_idle_timeout) + c.argument('load_balancer_outbound_ips', validator=validate_load_balancer_outbound_ips) + c.argument('load_balancer_outbound_ip_prefixes', validator=validate_load_balancer_outbound_ip_prefixes) + c.argument('load_balancer_outbound_ports', type=int, validator=validate_load_balancer_outbound_ports) + c.argument('load_balancer_idle_timeout', type=int, validator=validate_load_balancer_idle_timeout) + c.argument('nat_gateway_managed_outbound_ip_count', type=int, validator=validate_nat_gateway_managed_outbound_ip_count) + c.argument('nat_gateway_idle_timeout', type=int, validator=validate_nat_gateway_idle_timeout) c.argument('auto_upgrade_channel', arg_type=get_enum_type(auto_upgrade_channels)) c.argument('cluster_autoscaler_profile', nargs='+') c.argument('uptime_sla', action='store_true') c.argument('no_uptime_sla', action='store_true') - c.argument('api_server_authorized_ip_ranges', - type=str, validator=validate_ip_ranges) + c.argument('api_server_authorized_ip_ranges', validator=validate_ip_ranges) c.argument('enable_public_fqdn', action='store_true') c.argument('disable_public_fqdn', action='store_true') c.argument('enable_managed_identity', action='store_true') - c.argument('assign_identity', type=str, - validator=validate_assign_identity) - c.argument('assign_kubelet_identity', - validator=validate_assign_kubelet_identity) + c.argument('assign_identity', validator=validate_assign_identity) + c.argument('assign_kubelet_identity', validator=validate_assign_kubelet_identity) c.argument('enable_aad', action='store_true') c.argument('enable_azure_rbac', action='store_true') c.argument('disable_azure_rbac', action='store_true') c.argument('aad_tenant_id') c.argument('aad_admin_group_object_ids') - c.argument('windows_admin_password', options_list=[ - '--windows-admin-password']) - c.argument('enable_ahub', options_list=['--enable-ahub']) - c.argument('disable_ahub', options_list=['--disable-ahub']) - c.argument('enable_windows_gmsa', action='store_true', - options_list=['--enable-windows-gmsa']) - c.argument('gmsa_dns_server', options_list=['--gmsa-dns-server']) - c.argument('gmsa_root_domain_name', options_list=[ - '--gmsa-root-domain-name']) + c.argument('windows_admin_password') + c.argument('enable_ahub') + c.argument('disable_ahub') + c.argument('enable_windows_gmsa', action='store_true') + c.argument('gmsa_dns_server') + c.argument('gmsa_root_domain_name') c.argument('attach_acr', acr_arg_type, validator=validate_acr) c.argument('detach_acr', acr_arg_type, validator=validate_acr) # addons c.argument('enable_secret_rotation', action='store_true') c.argument('disable_secret_rotation', action='store_true') - c.argument('rotation_poll_interval', type=str) + c.argument('rotation_poll_interval') # nodepool paramerters c.argument('enable_cluster_autoscaler', options_list=[ "--enable-cluster-autoscaler", "-e"], action='store_true') @@ -392,7 +346,7 @@ def load_arguments(self, _): c.argument('aks_custom_headers') # extensions # managed cluster - c.argument('http_proxy_config', type=str) + c.argument('http_proxy_config') c.argument('enable_pod_security_policy', action='store_true') c.argument('disable_pod_security_policy', action='store_true') c.argument('enable_pod_identity', action='store_true') @@ -400,13 +354,11 @@ def load_arguments(self, _): c.argument('enable_workload_identity', arg_type=get_three_state_flag(), is_preview=True) c.argument('disable_workload_identity', arg_type=get_three_state_flag(), is_preview=True) c.argument('enable_oidc_issuer', action='store_true', is_preview=True) - c.argument('enable_azure_keyvault_kms', - action='store_true', is_preview=True) - c.argument('azure_keyvault_kms_key_id', - validator=validate_azure_keyvault_kms_key_id, is_preview=True) + c.argument('enable_azure_keyvault_kms', action='store_true', is_preview=True) + c.argument('azure_keyvault_kms_key_id', validator=validate_azure_keyvault_kms_key_id, is_preview=True) with self.argument_context('aks scale') as c: - c.argument('nodepool_name', type=str, + c.argument('nodepool_name', help='Node pool name, upto 12 alphanumeric characters', validator=validate_nodepool_name) with self.argument_context('aks upgrade') as c: @@ -416,42 +368,42 @@ def load_arguments(self, _): '--yes', '-y'], help='Do not prompt for confirmation.', action='store_true') with self.argument_context('aks maintenanceconfiguration') as c: - c.argument('cluster_name', type=str, help='The cluster name.') + c.argument('cluster_name', help='The cluster name.') for scope in ['aks maintenanceconfiguration add', 'aks maintenanceconfiguration update']: with self.argument_context(scope) as c: - c.argument('config_name', type=str, options_list=[ + c.argument('config_name', options_list=[ '--name', '-n'], help='The config name.') - c.argument('config_file', type=str, options_list=[ + c.argument('config_file', options_list=[ '--config-file'], help='The config json file.', required=False) - c.argument('weekday', type=str, options_list=[ + c.argument('weekday', options_list=[ '--weekday'], help='weekday on which maintenance can happen. e.g. Monday', required=False) c.argument('start_hour', type=int, options_list=[ '--start-hour'], help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am', required=False) for scope in ['aks maintenanceconfiguration show', 'aks maintenanceconfiguration delete']: with self.argument_context(scope) as c: - c.argument('config_name', type=str, options_list=[ + c.argument('config_name', options_list=[ '--name', '-n'], help='The config name.') with self.argument_context('aks nodepool') as c: - c.argument('cluster_name', type=str, help='The cluster name.') + c.argument('cluster_name', help='The cluster name.') for scope in ['aks nodepool add']: with self.argument_context(scope) as c: - c.argument('nodepool_name', type=str, options_list=[ + c.argument('nodepool_name', options_list=[ '--name', '-n'], validator=validate_nodepool_name, help='The node pool name.') c.argument('node_vm_size', options_list=[ '--node-vm-size', '-s'], completer=get_vm_size_completion_list) - c.argument('os_type', type=str) - c.argument('os_sku', type=str, options_list=[ + c.argument('os_type') + c.argument('os_sku', options_list=[ '--os-sku'], completer=get_ossku_completion_list) - c.argument('vnet_subnet_id', type=str, + c.argument('vnet_subnet_id', validator=validate_vnet_subnet_id) - c.argument('pod_subnet_id', type=str, + c.argument('pod_subnet_id', validator=validate_pod_subnet_id) c.argument('enable_node_public_ip', action='store_true') - c.argument('node_public_ip_prefix_id', type=str) + c.argument('node_public_ip_prefix_id') c.argument('enable_cluster_autoscaler', options_list=[ "--enable-cluster-autoscaler", "-e"], action='store_true') c.argument('min_count', type=int, validator=validate_nodes_count) @@ -467,31 +419,29 @@ def load_arguments(self, _): c.argument('node_osdisk_size', type=int) c.argument('mode', arg_type=get_enum_type(node_mode_types)) c.argument('scale_down_mode', arg_type=get_enum_type(scale_down_modes)) - c.argument('max_surge', type=str, validator=validate_max_surge) + c.argument('max_surge', validator=validate_max_surge) c.argument('max_pods', type=int, options_list=['--max-pods', '-m']) - c.argument('node_zones', zones_type, options_list=[ - '--node-zones', '--zones', '-z'], help='(--node-zones will be deprecated) Space-separated list of availability zones where agent nodes will be placed.') + c.argument('node_zones', zones_type, options_list=['--node-zones'], help='(--node-zones will be deprecated) Space-separated list of availability zones where agent nodes will be placed.', deprecate_info=c.deprecate(redirect='--zones', hide='2.37.0')) + c.argument('zones', zones_type, options_list=['--zones', '-z'], help='Space-separated list of availability zones where agent nodes will be placed.') c.argument('ppg') c.argument('enable_encryption_at_host', options_list=[ '--enable-encryption-at-host'], action='store_true') c.argument('enable_ultra_ssd', action='store_true') c.argument('enable_fips_image', action='store_true') - c.argument('snapshot_id', type=str, validator=validate_snapshot_id) - c.argument('kubelet_config', type=str) - c.argument('linux_os_config', type=str) + c.argument('snapshot_id', validator=validate_snapshot_id) + c.argument('kubelet_config') + c.argument('linux_os_config') c.argument('aks_custom_headers') # extensions - c.argument('host_group_id', - validator=validate_host_group_id, is_preview=True) + c.argument('host_group_id', validator=validate_host_group_id, is_preview=True) c.argument('crg_id', validator=validate_crg_id, is_preview=True) - c.argument('message_of_the_day', type=str, - validator=validate_message_of_the_day) + c.argument('message_of_the_day', validator=validate_message_of_the_day) c.argument('workload_runtime', arg_type=get_enum_type(workload_runtimes), default=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER) c.argument('gpu_instance_profile', arg_type=get_enum_type(gpu_instance_profiles)) for scope in ['aks nodepool show', 'aks nodepool scale', 'aks nodepool upgrade', 'aks nodepool update']: with self.argument_context(scope) as c: - c.argument('nodepool_name', type=str, options_list=[ + c.argument('nodepool_name', options_list=[ '--name', '-n'], validator=validate_nodepool_name, help='The node pool name.') with self.argument_context('aks nodepool delete') as c: @@ -502,9 +452,9 @@ def load_arguments(self, _): help='delete an AKS nodepool by ignoring PodDisruptionBudget setting') with self.argument_context('aks nodepool upgrade') as c: - c.argument('max_surge', type=str, validator=validate_max_surge) + c.argument('max_surge', validator=validate_max_surge) c.argument('aks_custom_headers') - c.argument('snapshot_id', type=str, validator=validate_snapshot_id) + c.argument('snapshot_id', validator=validate_snapshot_id) with self.argument_context('aks nodepool update') as c: c.argument('enable_cluster_autoscaler', options_list=[ @@ -520,7 +470,7 @@ def load_arguments(self, _): c.argument('node_taints', validator=validate_taints) c.argument('mode', arg_type=get_enum_type(node_mode_types)) c.argument('scale_down_mode', arg_type=get_enum_type(scale_down_modes)) - c.argument('max_surge', type=str, validator=validate_max_surge) + c.argument('max_surge', validator=validate_max_surge) with self.argument_context('aks addon show') as c: c.argument('addon', options_list=[ @@ -545,7 +495,7 @@ def load_arguments(self, _): c.argument('appgw_watch_namespace', options_list=[ '--appgw-watch-namespace'], arg_group='Application Gateway') c.argument('enable_secret_rotation', action='store_true') - c.argument('rotation_poll_interval', type=str) + c.argument('rotation_poll_interval') c.argument('workspace_resource_id') c.argument('enable_msi_auth_for_monitoring', arg_type=get_three_state_flag(), is_preview=True) @@ -573,7 +523,7 @@ def load_arguments(self, _): c.argument('appgw_watch_namespace', options_list=[ '--appgw-watch-namespace'], arg_group='Application Gateway') c.argument('enable_secret_rotation', action='store_true') - c.argument('rotation_poll_interval', type=str) + c.argument('rotation_poll_interval') c.argument('workspace_resource_id') c.argument('enable_msi_auth_for_monitoring', arg_type=get_three_state_flag(), is_preview=True) @@ -601,7 +551,7 @@ def load_arguments(self, _): c.argument('appgw_watch_namespace', options_list=[ '--appgw-watch-namespace'], arg_group='Application Gateway') c.argument('enable_secret_rotation', action='store_true') - c.argument('rotation_poll_interval', type=str) + c.argument('rotation_poll_interval') c.argument('workspace_resource_id') c.argument('enable_msi_auth_for_monitoring', arg_type=get_three_state_flag(), is_preview=True) @@ -618,31 +568,31 @@ def load_arguments(self, _): c.argument('credential_format', options_list=['--format'], arg_type=get_enum_type(credential_formats)) with self.argument_context('aks pod-identity') as c: - c.argument('cluster_name', type=str, help='The cluster name.') + c.argument('cluster_name', help='The cluster name.') with self.argument_context('aks pod-identity add') as c: - c.argument('identity_name', type=str, options_list=['--name', '-n'], default=None, required=False, + c.argument('identity_name', options_list=['--name', '-n'], default=None, required=False, help='The pod identity name. Generate if not specified.', validator=validate_pod_identity_resource_name('identity_name', required=False)) - c.argument('identity_namespace', type=str, options_list=[ + c.argument('identity_namespace', options_list=[ '--namespace'], help='The pod identity namespace.') - c.argument('identity_resource_id', type=str, options_list=[ + c.argument('identity_resource_id', options_list=[ '--identity-resource-id'], help='Resource id of the identity to use.') - c.argument('binding_selector', type=str, options_list=[ + c.argument('binding_selector', options_list=[ '--binding-selector'], help='Optional binding selector to use.') with self.argument_context('aks pod-identity delete') as c: - c.argument('identity_name', type=str, options_list=['--name', '-n'], default=None, required=True, + c.argument('identity_name', options_list=['--name', '-n'], default=None, required=True, help='The pod identity name.', validator=validate_pod_identity_resource_name('identity_name', required=True)) - c.argument('identity_namespace', type=str, options_list=[ + c.argument('identity_namespace', options_list=[ '--namespace'], help='The pod identity namespace.') with self.argument_context('aks pod-identity exception add') as c: - c.argument('exc_name', type=str, options_list=['--name', '-n'], default=None, required=False, + c.argument('exc_name', options_list=['--name', '-n'], default=None, required=False, help='The pod identity exception name. Generate if not specified.', validator=validate_pod_identity_resource_name('exc_name', required=False)) - c.argument('exc_namespace', type=str, options_list=['--namespace'], required=True, + c.argument('exc_namespace', options_list=['--namespace'], required=True, help='The pod identity exception namespace.', validator=validate_pod_identity_resource_namespace) c.argument('pod_labels', nargs='*', required=True, @@ -650,18 +600,18 @@ def load_arguments(self, _): validator=validate_pod_identity_pod_labels) with self.argument_context('aks pod-identity exception delete') as c: - c.argument('exc_name', type=str, options_list=['--name', '-n'], required=True, + c.argument('exc_name', options_list=['--name', '-n'], required=True, help='The pod identity exception name to remove.', validator=validate_pod_identity_resource_name('exc_name', required=True)) - c.argument('exc_namespace', type=str, options_list=['--namespace'], required=True, + c.argument('exc_namespace', options_list=['--namespace'], required=True, help='The pod identity exception namespace to remove.', validator=validate_pod_identity_resource_namespace) with self.argument_context('aks pod-identity exception update') as c: - c.argument('exc_name', type=str, options_list=['--name', '-n'], required=True, + c.argument('exc_name', options_list=['--name', '-n'], required=True, help='The pod identity exception name to remove.', validator=validate_pod_identity_resource_name('exc_name', required=True)) - c.argument('exc_namespace', type=str, options_list=['--namespace'], required=True, + c.argument('exc_namespace', options_list=['--namespace'], required=True, help='The pod identity exception namespace to remove.', validator=validate_pod_identity_resource_namespace) c.argument('pod_labels', nargs='*', required=True, @@ -670,32 +620,32 @@ def load_arguments(self, _): for scope in ['aks nodepool snapshot create']: with self.argument_context(scope) as c: - c.argument('snapshot_name', type=str, options_list=[ + c.argument('snapshot_name', options_list=[ '--name', '-n'], required=True, help='The nodepool snapshot name.', validator=validate_snapshot_name) c.argument('tags', tags_type) - c.argument('nodepool_id', type=str, required=True, + c.argument('nodepool_id', required=True, help='The nodepool id.', validator=validate_nodepool_id) c.argument('aks_custom_headers') for scope in ['aks nodepool snapshot show', 'aks nodepool snapshot delete']: with self.argument_context(scope) as c: - c.argument('snapshot_name', type=str, options_list=[ + c.argument('snapshot_name', options_list=[ '--name', '-n'], required=True, help='The nodepool snapshot name.', validator=validate_snapshot_name) c.argument('yes', options_list=[ '--yes', '-y'], help='Do not prompt for confirmation.', action='store_true') for scope in ['aks snapshot create']: with self.argument_context(scope) as c: - c.argument('snapshot_name', type=str, options_list=[ + c.argument('snapshot_name', options_list=[ '--name', '-n'], required=True, help='The cluster snapshot name.', validator=validate_snapshot_name) c.argument('tags', tags_type) - c.argument('cluster_id', type=str, required=True, + c.argument('cluster_id', required=True, validator=validate_cluster_id, help='The cluster id.') c.argument('aks_custom_headers') for scope in ['aks snapshot show', 'aks snapshot delete']: with self.argument_context(scope) as c: - c.argument('snapshot_name', type=str, options_list=[ + c.argument('snapshot_name', options_list=[ '--name', '-n'], required=True, help='The cluster snapshot name.', validator=validate_snapshot_name) c.argument('yes', options_list=[ '--yes', '-y'], help='Do not prompt for confirmation.', action='store_true') diff --git a/src/aks-preview/azext_aks_preview/agentpool_decorator.py b/src/aks-preview/azext_aks_preview/agentpool_decorator.py new file mode 100644 index 00000000000..a228c6bc244 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/agentpool_decorator.py @@ -0,0 +1,303 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import base64 +import os +from types import SimpleNamespace +from typing import Dict, TypeVar, Union, List + +from azure.cli.command_modules.acs._consts import AgentPoolDecoratorMode, DecoratorMode +from azure.cli.command_modules.acs.agentpool_decorator import ( + AKSAgentPoolAddDecorator, + AKSAgentPoolContext, + AKSAgentPoolModels, + AKSAgentPoolParamDict, + AKSAgentPoolUpdateDecorator, +) +from azure.cli.core.azclierror import InvalidArgumentValueError +from azure.cli.core.commands import AzCliCommand +from azure.cli.core.profiles import ResourceType +from azure.cli.core.util import read_file_content +from knack.log import get_logger + +from azext_aks_preview._client_factory import cf_agent_pools +from azext_aks_preview._consts import CONST_WORKLOAD_RUNTIME_OCI_CONTAINER +from azext_aks_preview._helpers import get_nodepool_snapshot_by_snapshot_id + +logger = get_logger(__name__) + +# type variables +AgentPool = TypeVar("AgentPool") +AgentPoolsOperations = TypeVar("AgentPoolsOperations") + + +# pylint: disable=too-few-public-methods +class AKSPreviewAgentPoolModels(AKSAgentPoolModels): + """Store the models used in aks agentpool series of commands. + + The api version of the class corresponding to a model is determined by resource_type. + """ + + +class AKSPreviewAgentPoolContext(AKSAgentPoolContext): + def __init__( + self, + cmd: AzCliCommand, + raw_parameters: AKSAgentPoolParamDict, + models: AKSAgentPoolModels, + decorator_mode: DecoratorMode, + agentpool_decorator_mode: AgentPoolDecoratorMode, + ): + super().__init__(cmd, raw_parameters, models, decorator_mode, agentpool_decorator_mode) + self.__external_functions = None + + @property + def external_functions(self) -> SimpleNamespace: + if self.__external_functions is None: + external_functions = vars(super().external_functions) + external_functions["cf_agent_pools"] = cf_agent_pools + external_functions["get_snapshot_by_snapshot_id"] = get_nodepool_snapshot_by_snapshot_id + self.__external_functions = SimpleNamespace(**external_functions) + return self.__external_functions + + def get_zones(self) -> Union[List[str], None]: + """Obtain the value of zones. + + Note: Inherited and extended in aks-preview to add support for a different parameter name (node_zones). + + :return: list of strings or None + """ + zones = super().get_zones() + if zones is not None: + return zones + # read the original value passed by the command + return self.raw_param.get("node_zones") + + def get_host_group_id(self) -> Union[str, None]: + """Obtain the value of host_group_id. + + :return: string or None + """ + # read the original value passed by the command + host_group_id = self.raw_param.get("host_group_id") + # try to read the property value corresponding to the parameter from the `agentpool` object + if ( + self.agentpool and + self.agentpool.host_group_id is not None + ): + host_group_id = self.agentpool.host_group_id + + # this parameter does not need dynamic completion + # this parameter does not need validation + return host_group_id + + def get_crg_id(self) -> Union[str, None]: + """Obtain the value of crg_id. + + :return: string or None + """ + # read the original value passed by the command + crg_id = self.raw_param.get("crg_id") + # try to read the property value corresponding to the parameter from the `agentpool` object + if ( + self.agentpool and + self.agentpool.capacity_reservation_group_id is not None + ): + crg_id = self.agentpool.capacity_reservation_group_id + + # this parameter does not need dynamic completion + # this parameter does not need validation + return crg_id + + def get_message_of_the_day(self) -> Union[str, None]: + """Obtain the value of message_of_the_day. + + :return: string or None + """ + # read the original value passed by the command + message_of_the_day = None + message_of_the_day_file_path = self.raw_param.get("message_of_the_day") + + if message_of_the_day_file_path: + if not os.path.isfile(message_of_the_day_file_path): + raise InvalidArgumentValueError( + "{} is not valid file, or not accessable.".format( + message_of_the_day_file_path + ) + ) + message_of_the_day = read_file_content( + message_of_the_day_file_path) + message_of_the_day = base64.b64encode( + bytes(message_of_the_day, 'ascii')).decode('ascii') + + # try to read the property value corresponding to the parameter from the `mc` object + if self.agentpool and self.agentpool.message_of_the_day is not None: + message_of_the_day = self.agentpool.message_of_the_day + + # this parameter does not need dynamic completion + # this parameter does not need validation + return message_of_the_day + + def get_gpu_instance_profile(self) -> Union[str, None]: + """Obtain the value of gpu_instance_profile. + + :return: string or None + """ + # read the original value passed by the command + gpu_instance_profile = self.raw_param.get("gpu_instance_profile") + # try to read the property value corresponding to the parameter from the `mc` object + if self.agentpool and self.agentpool.gpu_instance_profile is not None: + gpu_instance_profile = self.agentpool.gpu_instance_profile + + # this parameter does not need dynamic completion + # this parameter does not need validation + return gpu_instance_profile + + def get_workload_runtime(self) -> Union[str, None]: + """Obtain the value of workload_runtime, default value is CONST_WORKLOAD_RUNTIME_OCI_CONTAINER. + + :return: string or None + """ + # read the original value passed by the command + workload_runtime = self.raw_param.get("workload_runtime", CONST_WORKLOAD_RUNTIME_OCI_CONTAINER) + # try to read the property value corresponding to the parameter from the `mc` object + if self.agentpool and self.agentpool.workload_runtime is not None: + workload_runtime = self.agentpool.workload_runtime + + # this parameter does not need dynamic completion + # this parameter does not need validation + return workload_runtime + + +class AKSPreviewAgentPoolAddDecorator(AKSAgentPoolAddDecorator): + def __init__( + self, + cmd: AzCliCommand, + client: AgentPoolsOperations, + raw_parameters: Dict, + resource_type: ResourceType, + agentpool_decorator_mode: AgentPoolDecoratorMode, + ): + self.__raw_parameters = raw_parameters + super().__init__(cmd, client, raw_parameters, resource_type, agentpool_decorator_mode) + + def init_models(self) -> None: + """Initialize an AKSPreviewAgentPoolModels object to store the models. + + :return: None + """ + self.models = AKSPreviewAgentPoolModels(self.cmd, self.resource_type, self.agentpool_decorator_mode) + + def init_context(self) -> None: + """Initialize an AKSPreviewAgentPoolContext object to store the context in the process of assemble the + AgentPool object. + + :return: None + """ + self.context = AKSPreviewAgentPoolContext( + self.cmd, + AKSAgentPoolParamDict(self.__raw_parameters), + self.models, + DecoratorMode.CREATE, + self.agentpool_decorator_mode, + ) + + def set_up_preview_vm_properties(self, agentpool: AgentPool) -> AgentPool: + """Set up preview vm related properties for the AgentPool object. + + :return: the AgentPool object + """ + self._ensure_agentpool(agentpool) + + agentpool.host_group_id = self.context.get_host_group_id() + agentpool.capacity_reservation_group_id = self.context.get_crg_id() + return agentpool + + def set_up_motd(self, agentpool: AgentPool) -> AgentPool: + """Set up message of the day for the AgentPool object. + + :return: the AgentPool object + """ + self._ensure_agentpool(agentpool) + + agentpool.message_of_the_day = self.context.get_message_of_the_day() + return agentpool + + def set_up_gpu_propertes(self, agentpool: AgentPool) -> AgentPool: + """Set up gpu related properties for the AgentPool object. + + :return: the AgentPool object + """ + self._ensure_agentpool(agentpool) + + agentpool.gpu_instance_profile = self.context.get_gpu_instance_profile() + agentpool.workload_runtime = self.context.get_workload_runtime() + return agentpool + + def construct_agentpool_profile_preview(self) -> AgentPool: + """The overall controller used to construct the preview AgentPool profile. + + The completely constructed AgentPool object will later be passed as a parameter to the underlying SDK + (mgmt-containerservice) to send the actual request. + + :return: the AgentPool object + """ + # construct the default AgentPool profile + agentpool = self.construct_agentpool_profile_default(bypass_restore_defaults=True) + # set up preview vm properties + agentpool = self.set_up_preview_vm_properties(agentpool) + # set up message of the day + agentpool = self.set_up_motd(agentpool) + # set up gpu profiles + agentpool = self.set_up_gpu_propertes(agentpool) + # restore defaults + agentpool = self._restore_defaults_in_agentpool(agentpool) + return agentpool + + +class AKSPreviewAgentPoolUpdateDecorator(AKSAgentPoolUpdateDecorator): + def __init__( + self, + cmd: AzCliCommand, + client: AgentPoolsOperations, + raw_parameters: Dict, + resource_type: ResourceType, + agentpool_decorator_mode: AgentPoolDecoratorMode, + ): + self.__raw_parameters = raw_parameters + super().__init__(cmd, client, raw_parameters, resource_type, agentpool_decorator_mode) + + def init_models(self) -> None: + """Initialize an AKSPreviewAgentPoolModels object to store the models. + + :return: None + """ + self.models = AKSPreviewAgentPoolModels(self.cmd, self.resource_type, self.agentpool_decorator_mode) + + def init_context(self) -> None: + """Initialize an AKSPreviewAgentPoolContext object to store the context in the process of assemble the + AgentPool object. + + :return: None + """ + self.context = AKSPreviewAgentPoolContext( + self.cmd, + AKSAgentPoolParamDict(self.__raw_parameters), + self.models, + DecoratorMode.UPDATE, + self.agentpool_decorator_mode, + ) + + def update_agentpool_profile_preview(self, agentpools: List[AgentPool] = None) -> AgentPool: + """The overall controller used to update the preview AgentPool profile. + + The completely constructed AgentPool object will later be passed as a parameter to the underlying SDK + (mgmt-containerservice) to send the actual request. + + :return: the AgentPool object + """ + # fetch and update the default AgentPool profile + agentpool = self.update_agentpool_profile_default(agentpools) + return agentpool diff --git a/src/aks-preview/azext_aks_preview/custom.py b/src/aks-preview/azext_aks_preview/custom.py index 31b8ea892bc..9b2582c9d4a 100644 --- a/src/aks-preview/azext_aks_preview/custom.py +++ b/src/aks-preview/azext_aks_preview/custom.py @@ -52,7 +52,7 @@ from dateutil.parser import parse # pylint: disable=import-error from dateutil.relativedelta import relativedelta # pylint: disable=import-error from knack.log import get_logger -from knack.prompting import NoTTYException, prompt_pass +from knack.prompting import NoTTYException, prompt_pass, prompt_y_n from knack.util import CLIError from msrestazure.azure_exceptions import CloudError from six.moves.urllib.error import URLError # pylint: disable=import-error @@ -398,7 +398,6 @@ def delete_role_assignments(cli_ctx, ids=None, assignee=None, role=None, resourc assignments_client.delete_by_id(i) return if not any([ids, assignee, role, resource_group_name, scope, assignee, yes]): - from knack.prompting import prompt_y_n msg = 'This will delete all role assignments under the subscription. Are you sure?' if not prompt_y_n(msg, default="n"): return @@ -742,6 +741,7 @@ def aks_create(cmd, aad_tenant_id=None, tags=None, node_zones=None, + zones=None, enable_node_public_ip=False, node_public_ip_prefix_id=None, generate_ssh_keys=False, # pylint: disable=unused-argument @@ -1058,8 +1058,6 @@ def aks_kollect(cmd, # pylint: disable=too-many-statements,too-many-locals readonly_sas_token = readonly_sas_token.strip('?') - from knack.prompting import prompt_y_n - print() print('This will deploy a daemon set to your cluster to collect logs and diagnostic information and ' f'save them to the storage account ' @@ -1240,7 +1238,6 @@ def aks_upgrade(cmd, # pylint: disable=unused-argument, too-many-return-state node_image_only=False, aks_custom_headers=None, yes=False): - from knack.prompting import prompt_y_n msg = 'Kubernetes may be unavailable during cluster upgrades.\n Are you sure you want to perform this operation?' if not yes and not prompt_y_n(msg, default="n"): return None @@ -1597,6 +1594,7 @@ def aks_agentpool_add(cmd, # pylint: disable=unused-argument,too-many-local tags=None, kubernetes_version=None, node_zones=None, + zones=None, enable_node_public_ip=False, node_public_ip_prefix_id=None, node_vm_size=None, @@ -1837,10 +1835,12 @@ def aks_agentpool_update(cmd, # pylint: disable=unused-argument disable_cluster_autoscaler + update_cluster_autoscaler if (update_autoscaler != 1 and not tags and not scale_down_mode and not mode and not max_surge and labels is None and node_taints is None): - raise CLIError('Please specify one or more of "--enable-cluster-autoscaler" or ' - '"--disable-cluster-autoscaler" or ' - '"--update-cluster-autoscaler" or ' - '"--tags" or "--mode" or "--max-surge" or "--scale-down-mode" or "--labels" or "--node-taints') + reconcilePrompt = 'no argument specified to update would you like to reconcile to current settings?' + if not prompt_y_n(reconcilePrompt, default="n"): + raise CLIError('Please specify one or more of "--enable-cluster-autoscaler" or ' + '"--disable-cluster-autoscaler" or ' + '"--update-cluster-autoscaler" or ' + '"--tags" or "--mode" or "--max-surge" or "--scale-down-mode" or "--labels" or "--node-taints') instance = client.get(resource_group_name, cluster_name, nodepool_name) diff --git a/src/aks-preview/azext_aks_preview/decorator.py b/src/aks-preview/azext_aks_preview/decorator.py index 57b74fb58df..87e65e4a633 100644 --- a/src/aks-preview/azext_aks_preview/decorator.py +++ b/src/aks-preview/azext_aks_preview/decorator.py @@ -2345,61 +2345,63 @@ def check_raw_parameters(self): ) if not is_changed and is_default: - # Note: Uncomment the followings to automatically generate the error message. - # option_names = [ - # '"{}"'.format(format_parameter_name_to_option_name(x)) - # for x in self.context.raw_param.keys() - # if x not in excluded_keys - # ] - # error_msg = "Please specify one or more of {}.".format( - # " or ".join(option_names) - # ) - # raise RequiredArgumentMissingError(error_msg) - raise RequiredArgumentMissingError( - 'Please specify "--enable-cluster-autoscaler" or ' - '"--disable-cluster-autoscaler" or ' - '"--update-cluster-autoscaler" or ' - '"--cluster-autoscaler-profile" or ' - '"--enable-pod-security-policy" or ' - '"--disable-pod-security-policy" or ' - '"--api-server-authorized-ip-ranges" or ' - '"--attach-acr" or ' - '"--detach-acr" or ' - '"--uptime-sla" or ' - '"--no-uptime-sla" or ' - '"--load-balancer-managed-outbound-ip-count" or ' - '"--load-balancer-outbound-ips" or ' - '"--load-balancer-outbound-ip-prefixes" or ' - '"--nat-gateway-managed-outbound-ip-count" or ' - '"--nat-gateway-idle-timeout" or ' - '"--enable-aad" or ' - '"--aad-tenant-id" or ' - '"--aad-admin-group-object-ids" or ' - '"--enable-ahub" or ' - '"--disable-ahub" or ' - '"--enable-managed-identity" or ' - '"--enable-pod-identity" or ' - '"--disable-pod-identity" or ' - '"--auto-upgrade-channel" or ' - '"--enable-secret-rotation" or ' - '"--disable-secret-rotation" or ' - '"--rotation-poll-interval" or ' - '"--tags" or ' - '"--windows-admin-password" or ' - '"--enable-azure-rbac" or ' - '"--disable-azure-rbac" or ' - '"--enable-local-accounts" or ' - '"--disable-local-accounts" or ' - '"--enable-public-fqdn" or ' - '"--disable-public-fqdn"' - '"--enble-windows-gmsa" or ' - '"--nodepool-labels" or ' - '"--enable-oidc-issuer" or ' - '"--http-proxy-config" or ' - '"--enable-azure-keyvault-kms" or ' - '"--enable-workload-identity" or ' - '"--disable-workload-identity".' - ) + reconcilePrompt = 'no argument specified to update would you like to reconcile to current settings?' + if not prompt_y_n(reconcilePrompt, default="n"): + # Note: Uncomment the followings to automatically generate the error message. + # option_names = [ + # '"{}"'.format(format_parameter_name_to_option_name(x)) + # for x in self.context.raw_param.keys() + # if x not in excluded_keys + # ] + # error_msg = "Please specify one or more of {}.".format( + # " or ".join(option_names) + # ) + # raise RequiredArgumentMissingError(error_msg) + raise RequiredArgumentMissingError( + 'Please specify "--enable-cluster-autoscaler" or ' + '"--disable-cluster-autoscaler" or ' + '"--update-cluster-autoscaler" or ' + '"--cluster-autoscaler-profile" or ' + '"--enable-pod-security-policy" or ' + '"--disable-pod-security-policy" or ' + '"--api-server-authorized-ip-ranges" or ' + '"--attach-acr" or ' + '"--detach-acr" or ' + '"--uptime-sla" or ' + '"--no-uptime-sla" or ' + '"--load-balancer-managed-outbound-ip-count" or ' + '"--load-balancer-outbound-ips" or ' + '"--load-balancer-outbound-ip-prefixes" or ' + '"--nat-gateway-managed-outbound-ip-count" or ' + '"--nat-gateway-idle-timeout" or ' + '"--enable-aad" or ' + '"--aad-tenant-id" or ' + '"--aad-admin-group-object-ids" or ' + '"--enable-ahub" or ' + '"--disable-ahub" or ' + '"--enable-managed-identity" or ' + '"--enable-pod-identity" or ' + '"--disable-pod-identity" or ' + '"--auto-upgrade-channel" or ' + '"--enable-secret-rotation" or ' + '"--disable-secret-rotation" or ' + '"--rotation-poll-interval" or ' + '"--tags" or ' + '"--windows-admin-password" or ' + '"--enable-azure-rbac" or ' + '"--disable-azure-rbac" or ' + '"--enable-local-accounts" or ' + '"--disable-local-accounts" or ' + '"--enable-public-fqdn" or ' + '"--disable-public-fqdn"' + '"--enble-windows-gmsa" or ' + '"--nodepool-labels" or ' + '"--enable-oidc-issuer" or ' + '"--http-proxy-config" or ' + '"--enable-azure-keyvault-kms" or ' + '"--enable-workload-identity" or ' + '"--disable-workload-identity".' + ) def update_load_balancer_profile(self, mc: ManagedCluster) -> ManagedCluster: """Update load balancer profile for the ManagedCluster object. diff --git a/src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py b/src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py new file mode 100644 index 00000000000..aed8866b68c --- /dev/null +++ b/src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py @@ -0,0 +1,697 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import unittest +from unittest.mock import Mock, patch + +from azext_aks_preview.__init__ import register_aks_preview_resource_type +from azext_aks_preview._client_factory import CUSTOM_MGMT_AKS_PREVIEW +from azext_aks_preview._consts import CONST_WORKLOAD_RUNTIME_OCI_CONTAINER +from azext_aks_preview.agentpool_decorator import ( + AKSPreviewAgentPoolAddDecorator, + AKSPreviewAgentPoolContext, + AKSPreviewAgentPoolModels, + AKSPreviewAgentPoolUpdateDecorator, +) +from azext_aks_preview.tests.latest.utils import get_test_data_file_path +from azure.cli.command_modules.acs._consts import ( + CONST_DEFAULT_NODE_OS_TYPE, + CONST_DEFAULT_NODE_VM_SIZE, + CONST_NODEPOOL_MODE_SYSTEM, + CONST_NODEPOOL_MODE_USER, + CONST_SCALE_DOWN_MODE_DELETE, + CONST_VIRTUAL_MACHINE_SCALE_SETS, + AgentPoolDecoratorMode, + DecoratorMode, +) +from azure.cli.command_modules.acs.agentpool_decorator import AKSAgentPoolParamDict +from azure.cli.command_modules.acs.tests.latest.mocks import MockCLI, MockClient, MockCmd +from azure.cli.core.azclierror import CLIInternalError, InvalidArgumentValueError + + +class AKSPreviewAgentPoolContextCommonTestCase(unittest.TestCase): + def _remove_defaults_in_agentpool(self, agentpool): + self.defaults_in_agentpool = {} + for attr_name, attr_value in vars(agentpool).items(): + if not attr_name.startswith("_") and attr_name != "name" and attr_value is not None: + self.defaults_in_agentpool[attr_name] = attr_value + setattr(agentpool, attr_name, None) + return agentpool + + def _restore_defaults_in_agentpool(self, agentpool): + for key, value in self.defaults_in_agentpool.items(): + if getattr(agentpool, key, None) is None: + setattr(agentpool, key, value) + return agentpool + + def create_initialized_agentpool_instance( + self, nodepool_name="nodepool1", remove_defaults=True, restore_defaults=True, **kwargs + ): + """Helper function to create a properly initialized agentpool instance. + + :return: the AgentPool object + """ + if self.agentpool_decorator_mode == AgentPoolDecoratorMode.MANAGED_CLUSTER: + agentpool = self.models.UnifiedAgentPoolModel(name=nodepool_name) + else: + agentpool = self.models.UnifiedAgentPoolModel() + agentpool.name = nodepool_name + + # remove defaults + if remove_defaults: + self._remove_defaults_in_agentpool(agentpool) + + # set properties + for key, value in kwargs.items(): + setattr(agentpool, key, value) + + # resote defaults + if restore_defaults: + self._restore_defaults_in_agentpool(agentpool) + return agentpool + + def common_get_zones(self): + # default + ctx_1 = AKSPreviewAgentPoolContext( + self.cmd, + AKSAgentPoolParamDict({"zone": None, "node_zones": "test_node_zones"}), + self.models, + DecoratorMode.CREATE, + self.agentpool_decorator_mode, + ) + self.assertEqual(ctx_1.get_zones(), "test_node_zones") + agentpool_1 = self.create_initialized_agentpool_instance( + availability_zones=["test_mc_zones1", "test_mc_zones2"] + ) + ctx_1.attach_agentpool(agentpool_1) + self.assertEqual(ctx_1.get_zones(), ["test_mc_zones1", "test_mc_zones2"]) + + # custom value + ctx_2 = AKSPreviewAgentPoolContext( + self.cmd, + AKSAgentPoolParamDict({"zones": "test_zones", "node_zones": "test_node_zones"}), + self.models, + DecoratorMode.CREATE, + self.agentpool_decorator_mode, + ) + self.assertEqual(ctx_2.get_zones(), "test_zones") + + def common_get_host_group_id(self): + # default + ctx_1 = AKSPreviewAgentPoolContext( + self.cmd, + AKSAgentPoolParamDict({"host_group_id": None}), + self.models, + DecoratorMode.CREATE, + self.agentpool_decorator_mode, + ) + self.assertEqual(ctx_1.get_host_group_id(), None) + agentpool_1 = self.create_initialized_agentpool_instance(host_group_id="test_host_group_id") + ctx_1.attach_agentpool(agentpool_1) + self.assertEqual(ctx_1.get_host_group_id(), "test_host_group_id") + + def common_get_crg_id(self): + # default + ctx_1 = AKSPreviewAgentPoolContext( + self.cmd, + AKSAgentPoolParamDict({"crg_id": None}), + self.models, + DecoratorMode.CREATE, + self.agentpool_decorator_mode, + ) + self.assertEqual(ctx_1.get_crg_id(), None) + agentpool_1 = self.create_initialized_agentpool_instance( + capacity_reservation_group_id="test_capacity_reservation_group_id" + ) + ctx_1.attach_agentpool(agentpool_1) + self.assertEqual(ctx_1.get_crg_id(), "test_capacity_reservation_group_id") + + def common_get_message_of_the_day(self): + # default + ctx_1 = AKSPreviewAgentPoolContext( + self.cmd, + AKSAgentPoolParamDict({"message_of_the_day": None}), + self.models, + DecoratorMode.CREATE, + self.agentpool_decorator_mode, + ) + self.assertEqual(ctx_1.get_message_of_the_day(), None) + agentpool_1 = self.create_initialized_agentpool_instance(message_of_the_day="test_message_of_the_day") + ctx_1.attach_agentpool(agentpool_1) + self.assertEqual(ctx_1.get_message_of_the_day(), "test_message_of_the_day") + + # custom + ctx_2 = AKSPreviewAgentPoolContext( + self.cmd, + AKSAgentPoolParamDict({"message_of_the_day": get_test_data_file_path("motd.txt")}), + self.models, + DecoratorMode.CREATE, + self.agentpool_decorator_mode, + ) + self.assertEqual( + ctx_2.get_message_of_the_day(), + "VU5BVVRIT1JJWkVEIEFDQ0VTUyBUTyBUSElTIERFVklDRSBJUyBQUk9ISUJJVEVECgpZb3UgbXVzdCBoYXZlIGV4cGxpY2l0LCBhdXRob3JpemVkIHBlcm1pc3Npb24gdG8gYWNjZXNzIG9yIGNvbmZpZ3VyZSB0aGlzIGRldmljZS4gVW5hdXRob3JpemVkIGF0dGVtcHRzIGFuZCBhY3Rpb25zIHRvIGFjY2VzcyBvciB1c2UgdGhpcyBzeXN0ZW0gbWF5IHJlc3VsdCBpbiBjaXZpbCBhbmQvb3IgY3JpbWluYWwgcGVuYWx0aWVzLiBBbGwgYWN0aXZpdGllcyBwZXJmb3JtZWQgb24gdGhpcyBkZXZpY2UgYXJlIGxvZ2dlZCBhbmQgbW9uaXRvcmVkLgo=", + ) + + # custom + ctx_3 = AKSPreviewAgentPoolContext( + self.cmd, + AKSAgentPoolParamDict({"message_of_the_day": "fake-path"}), + self.models, + DecoratorMode.CREATE, + self.agentpool_decorator_mode, + ) + with self.assertRaises(InvalidArgumentValueError): + ctx_3.get_message_of_the_day() + + def common_get_gpu_instance_profile(self): + # default + ctx_1 = AKSPreviewAgentPoolContext( + self.cmd, + AKSAgentPoolParamDict({"gpu_instance_profile": None}), + self.models, + DecoratorMode.CREATE, + self.agentpool_decorator_mode, + ) + self.assertEqual(ctx_1.get_gpu_instance_profile(), None) + agentpool_1 = self.create_initialized_agentpool_instance(gpu_instance_profile="test_gpu_instance_profile") + ctx_1.attach_agentpool(agentpool_1) + self.assertEqual(ctx_1.get_gpu_instance_profile(), "test_gpu_instance_profile") + + def common_get_workload_runtime(self): + # default + ctx_1 = AKSPreviewAgentPoolContext( + self.cmd, + AKSAgentPoolParamDict({"workload_runtime": None}), + self.models, + DecoratorMode.CREATE, + self.agentpool_decorator_mode, + ) + self.assertEqual(ctx_1.get_workload_runtime(), CONST_WORKLOAD_RUNTIME_OCI_CONTAINER) + agentpool_1 = self.create_initialized_agentpool_instance(workload_runtime="test_workload_runtime") + ctx_1.attach_agentpool(agentpool_1) + self.assertEqual(ctx_1.get_workload_runtime(), "test_workload_runtime") + + +class AKSPreviewAgentPoolContextStandaloneModeTestCase(AKSPreviewAgentPoolContextCommonTestCase): + def setUp(self): + # manually register CUSTOM_MGMT_AKS_PREVIEW + register_aks_preview_resource_type() + self.cli_ctx = MockCLI() + self.cmd = MockCmd(self.cli_ctx) + self.resource_type = CUSTOM_MGMT_AKS_PREVIEW + self.agentpool_decorator_mode = AgentPoolDecoratorMode.STANDALONE + self.models = AKSPreviewAgentPoolModels(self.cmd, self.resource_type, self.agentpool_decorator_mode) + + def test_get_zones(self): + self.common_get_zones() + + def test_get_host_group_id(self): + self.common_get_host_group_id() + + def test_get_crg_id(self): + self.common_get_crg_id() + + def test_get_message_of_the_day(self): + self.common_get_message_of_the_day() + + def test_get_gpu_instance_profile(self): + self.common_get_gpu_instance_profile() + + def test_get_workload_runtime(self): + self.common_get_workload_runtime() + + +class AKSPreviewAgentPoolContextManagedClusterModeTestCase(AKSPreviewAgentPoolContextCommonTestCase): + def setUp(self): + # manually register CUSTOM_MGMT_AKS_PREVIEW + register_aks_preview_resource_type() + self.cli_ctx = MockCLI() + self.cmd = MockCmd(self.cli_ctx) + self.resource_type = CUSTOM_MGMT_AKS_PREVIEW + self.agentpool_decorator_mode = AgentPoolDecoratorMode.MANAGED_CLUSTER + self.models = AKSPreviewAgentPoolModels(self.cmd, self.resource_type, self.agentpool_decorator_mode) + + def test_get_zones(self): + self.common_get_zones() + + def test_get_host_group_id(self): + self.common_get_host_group_id() + + def test_get_crg_id(self): + self.common_get_crg_id() + + def test_get_message_of_the_day(self): + self.common_get_message_of_the_day() + + def test_get_gpu_instance_profile(self): + self.common_get_gpu_instance_profile() + + def test_get_workload_runtime(self): + self.common_get_workload_runtime() + + +class AKSPreviewAgentPoolAddDecoratorCommonTestCase(unittest.TestCase): + def _remove_defaults_in_agentpool(self, agentpool): + self.defaults_in_agentpool = {} + for attr_name, attr_value in vars(agentpool).items(): + if not attr_name.startswith("_") and attr_name != "name" and attr_value is not None: + self.defaults_in_agentpool[attr_name] = attr_value + setattr(agentpool, attr_name, None) + return agentpool + + def _restore_defaults_in_agentpool(self, agentpool): + for key, value in self.defaults_in_agentpool.items(): + if getattr(agentpool, key, None) is None: + setattr(agentpool, key, value) + return agentpool + + def create_initialized_agentpool_instance( + self, nodepool_name="nodepool1", remove_defaults=True, restore_defaults=True, **kwargs + ): + """Helper function to create a properly initialized agentpool instance. + + :return: the AgentPool object + """ + if self.agentpool_decorator_mode == AgentPoolDecoratorMode.MANAGED_CLUSTER: + agentpool = self.models.UnifiedAgentPoolModel(name=nodepool_name) + else: + agentpool = self.models.UnifiedAgentPoolModel() + agentpool.name = nodepool_name + + # remove defaults + if remove_defaults: + self._remove_defaults_in_agentpool(agentpool) + + # set properties + for key, value in kwargs.items(): + setattr(agentpool, key, value) + + # resote defaults + if restore_defaults: + self._restore_defaults_in_agentpool(agentpool) + return agentpool + + def common_set_up_preview_vm_properties(self): + dec_1 = AKSPreviewAgentPoolAddDecorator( + self.cmd, + self.client, + {"host_group_id": "test_host_group_id", "crg_id": "test_crg_id"}, + self.resource_type, + self.agentpool_decorator_mode, + ) + # fail on passing the wrong agentpool object + with self.assertRaises(CLIInternalError): + dec_1.set_up_preview_vm_properties(None) + agentpool_1 = self.create_initialized_agentpool_instance(restore_defaults=False) + dec_1.context.attach_agentpool(agentpool_1) + dec_agentpool_1 = dec_1.set_up_preview_vm_properties(agentpool_1) + dec_agentpool_1 = self._restore_defaults_in_agentpool(dec_agentpool_1) + ground_truth_agentpool_1 = self.create_initialized_agentpool_instance( + host_group_id="test_host_group_id", capacity_reservation_group_id="test_crg_id" + ) + self.assertEqual(dec_agentpool_1, ground_truth_agentpool_1) + + def common_set_up_motd(self): + dec_1 = AKSPreviewAgentPoolAddDecorator( + self.cmd, + self.client, + {"message_of_the_day": get_test_data_file_path("motd.txt")}, + self.resource_type, + self.agentpool_decorator_mode, + ) + # fail on passing the wrong agentpool object + with self.assertRaises(CLIInternalError): + dec_1.set_up_motd(None) + agentpool_1 = self.create_initialized_agentpool_instance(restore_defaults=False) + dec_1.context.attach_agentpool(agentpool_1) + dec_agentpool_1 = dec_1.set_up_motd(agentpool_1) + dec_agentpool_1 = self._restore_defaults_in_agentpool(dec_agentpool_1) + ground_truth_agentpool_1 = self.create_initialized_agentpool_instance( + message_of_the_day="VU5BVVRIT1JJWkVEIEFDQ0VTUyBUTyBUSElTIERFVklDRSBJUyBQUk9ISUJJVEVECgpZb3UgbXVzdCBoYXZlIGV4cGxpY2l0LCBhdXRob3JpemVkIHBlcm1pc3Npb24gdG8gYWNjZXNzIG9yIGNvbmZpZ3VyZSB0aGlzIGRldmljZS4gVW5hdXRob3JpemVkIGF0dGVtcHRzIGFuZCBhY3Rpb25zIHRvIGFjY2VzcyBvciB1c2UgdGhpcyBzeXN0ZW0gbWF5IHJlc3VsdCBpbiBjaXZpbCBhbmQvb3IgY3JpbWluYWwgcGVuYWx0aWVzLiBBbGwgYWN0aXZpdGllcyBwZXJmb3JtZWQgb24gdGhpcyBkZXZpY2UgYXJlIGxvZ2dlZCBhbmQgbW9uaXRvcmVkLgo=", + ) + self.assertEqual(dec_agentpool_1, ground_truth_agentpool_1) + + def common_set_up_gpu_propertes(self): + dec_1 = AKSPreviewAgentPoolAddDecorator( + self.cmd, + self.client, + {"gpu_instance_profile": "test_gpu_instance_profile", "workload_runtime": "test_workload_runtime"}, + self.resource_type, + self.agentpool_decorator_mode, + ) + # fail on passing the wrong agentpool object + with self.assertRaises(CLIInternalError): + dec_1.set_up_gpu_propertes(None) + agentpool_1 = self.create_initialized_agentpool_instance(restore_defaults=False) + dec_1.context.attach_agentpool(agentpool_1) + dec_agentpool_1 = dec_1.set_up_gpu_propertes(agentpool_1) + dec_agentpool_1 = self._restore_defaults_in_agentpool(dec_agentpool_1) + ground_truth_agentpool_1 = self.create_initialized_agentpool_instance( + gpu_instance_profile="test_gpu_instance_profile", + workload_runtime="test_workload_runtime", + ) + self.assertEqual(dec_agentpool_1, ground_truth_agentpool_1) + + +class AKSPreviewAgentPoolAddDecoratorStandaloneModeTestCase(AKSPreviewAgentPoolAddDecoratorCommonTestCase): + def setUp(self): + # manually register CUSTOM_MGMT_AKS_PREVIEW + register_aks_preview_resource_type() + self.cli_ctx = MockCLI() + self.cmd = MockCmd(self.cli_ctx) + self.resource_type = CUSTOM_MGMT_AKS_PREVIEW + self.agentpool_decorator_mode = AgentPoolDecoratorMode.STANDALONE + self.models = AKSPreviewAgentPoolModels(self.cmd, self.resource_type, self.agentpool_decorator_mode) + self.client = MockClient() + + def test_set_up_preview_vm_properties(self): + self.common_set_up_preview_vm_properties() + + def test_set_up_motd(self): + self.common_set_up_motd() + + def test_set_up_gpu_propertes(self): + self.common_set_up_gpu_propertes() + + def test_construct_agentpool_profile_preview(self): + import inspect + + from azext_aks_preview.custom import aks_agentpool_add + + optional_params = {} + positional_params = [] + for _, v in inspect.signature(aks_agentpool_add).parameters.items(): + if v.default != v.empty: + optional_params[v.name] = v.default + else: + positional_params.append(v.name) + ground_truth_positional_params = [ + "cmd", + "client", + "resource_group_name", + "cluster_name", + "nodepool_name", + ] + self.assertEqual(positional_params, ground_truth_positional_params) + + # prepare a dictionary of default parameters + raw_param_dict = { + "resource_group_name": "test_rg_name", + "cluster_name": "test_cluster_name", + "nodepool_name": "test_nodepool_name", + } + raw_param_dict.update(optional_params) + + # default value in `aks nodepool add` + dec_1 = AKSPreviewAgentPoolAddDecorator( + self.cmd, + self.client, + raw_param_dict, + self.resource_type, + self.agentpool_decorator_mode, + ) + + with patch( + "azext_aks_preview.agentpool_decorator.cf_agent_pools", + return_value=Mock(list=Mock(return_value=[])), + ): + dec_agentpool_1 = dec_1.construct_agentpool_profile_preview() + + ground_truth_upgrade_settings_1 = self.models.AgentPoolUpgradeSettings() + ground_truth_agentpool_1 = self.create_initialized_agentpool_instance( + nodepool_name="test_nodepool_name", + upgrade_settings=ground_truth_upgrade_settings_1, + os_disk_size_gb=0, + enable_auto_scaling=False, + count=3, + os_type=CONST_DEFAULT_NODE_OS_TYPE, + vm_size=CONST_DEFAULT_NODE_VM_SIZE, + node_taints=[], + enable_node_public_ip=False, + type_properties_type=CONST_VIRTUAL_MACHINE_SCALE_SETS, + enable_encryption_at_host=False, + enable_ultra_ssd=False, + enable_fips=False, + mode=CONST_NODEPOOL_MODE_USER, + scale_down_mode=CONST_SCALE_DOWN_MODE_DELETE, + workload_runtime=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER, + ) + self.assertEqual(dec_agentpool_1, ground_truth_agentpool_1) + + dec_1.context.raw_param.print_usage_statistics() + + +class AKSPreviewAgentPoolAddDecoratorManagedClusterModeTestCase(AKSPreviewAgentPoolAddDecoratorCommonTestCase): + def setUp(self): + # manually register CUSTOM_MGMT_AKS_PREVIEW + register_aks_preview_resource_type() + self.cli_ctx = MockCLI() + self.cmd = MockCmd(self.cli_ctx) + self.resource_type = CUSTOM_MGMT_AKS_PREVIEW + self.agentpool_decorator_mode = AgentPoolDecoratorMode.MANAGED_CLUSTER + self.models = AKSPreviewAgentPoolModels(self.cmd, self.resource_type, self.agentpool_decorator_mode) + self.client = MockClient() + + def test_set_up_preview_vm_properties(self): + self.common_set_up_preview_vm_properties() + + def test_set_up_motd(self): + self.common_set_up_motd() + + def test_set_up_gpu_propertes(self): + self.common_set_up_gpu_propertes() + + def test_construct_agentpool_profile_preview(self): + import inspect + + from azext_aks_preview.custom import aks_create + + optional_params = {} + positional_params = [] + for _, v in inspect.signature(aks_create).parameters.items(): + if v.default != v.empty: + optional_params[v.name] = v.default + else: + positional_params.append(v.name) + ground_truth_positional_params = [ + "cmd", + "client", + "resource_group_name", + "name", + "ssh_key_value", + ] + self.assertEqual(positional_params, ground_truth_positional_params) + + # prepare a dictionary of default parameters + raw_param_dict = { + "resource_group_name": "test_rg_name", + "name": "test_cluster_name", + "ssh_key_value": None, + } + raw_param_dict.update(optional_params) + + # default value in `aks_create` + dec_1 = AKSPreviewAgentPoolAddDecorator( + self.cmd, + self.client, + raw_param_dict, + self.resource_type, + self.agentpool_decorator_mode, + ) + + with patch( + "azure.cli.command_modules.acs.agentpool_decorator.cf_agent_pools", + return_value=Mock(list=Mock(return_value=[])), + ): + dec_agentpool_1 = dec_1.construct_agentpool_profile_preview() + + upgrade_settings_1 = self.models.AgentPoolUpgradeSettings() + ground_truth_agentpool_1 = self.create_initialized_agentpool_instance( + nodepool_name="nodepool1", + upgrade_settings=upgrade_settings_1, + os_disk_size_gb=0, + enable_auto_scaling=False, + count=3, + orchestrator_version="", + os_type=CONST_DEFAULT_NODE_OS_TYPE, + vm_size=CONST_DEFAULT_NODE_VM_SIZE, + node_taints=[], + enable_node_public_ip=False, + type=CONST_VIRTUAL_MACHINE_SCALE_SETS, + enable_encryption_at_host=False, + enable_ultra_ssd=False, + enable_fips=False, + mode=CONST_NODEPOOL_MODE_SYSTEM, + workload_runtime=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER, + ) + self.assertEqual(dec_agentpool_1, ground_truth_agentpool_1) + + dec_1.context.raw_param.print_usage_statistics() + + +class AKSPreviewAgentPoolUpdateDecoratorCommonTestCase(unittest.TestCase): + def _remove_defaults_in_agentpool(self, agentpool): + self.defaults_in_agentpool = {} + for attr_name, attr_value in vars(agentpool).items(): + if not attr_name.startswith("_") and attr_name != "name" and attr_value is not None: + self.defaults_in_agentpool[attr_name] = attr_value + setattr(agentpool, attr_name, None) + return agentpool + + def _restore_defaults_in_agentpool(self, agentpool): + for key, value in self.defaults_in_agentpool.items(): + if getattr(agentpool, key, None) is None: + setattr(agentpool, key, value) + return agentpool + + def create_initialized_agentpool_instance( + self, nodepool_name="nodepool1", remove_defaults=True, restore_defaults=True, **kwargs + ): + """Helper function to create a properly initialized agentpool instance. + + :return: the AgentPool object + """ + if self.agentpool_decorator_mode == AgentPoolDecoratorMode.MANAGED_CLUSTER: + agentpool = self.models.UnifiedAgentPoolModel(name=nodepool_name) + else: + agentpool = self.models.UnifiedAgentPoolModel() + agentpool.name = nodepool_name + + # remove defaults + if remove_defaults: + self._remove_defaults_in_agentpool(agentpool) + + # set properties + for key, value in kwargs.items(): + setattr(agentpool, key, value) + + # resote defaults + if restore_defaults: + self._restore_defaults_in_agentpool(agentpool) + return agentpool + + +class AKSPreviewAgentPoolUpdateDecoratorStandaloneModeTestCase(AKSPreviewAgentPoolUpdateDecoratorCommonTestCase): + def setUp(self): + # manually register CUSTOM_MGMT_AKS_PREVIEW + register_aks_preview_resource_type() + self.cli_ctx = MockCLI() + self.cmd = MockCmd(self.cli_ctx) + self.resource_type = CUSTOM_MGMT_AKS_PREVIEW + self.agentpool_decorator_mode = AgentPoolDecoratorMode.STANDALONE + self.models = AKSPreviewAgentPoolModels(self.cmd, self.resource_type, self.agentpool_decorator_mode) + self.client = MockClient() + + def test_update_agentpool_profile_preview(self): + import inspect + + from azext_aks_preview.custom import aks_agentpool_update + + optional_params = {} + positional_params = [] + for _, v in inspect.signature(aks_agentpool_update).parameters.items(): + if v.default != v.empty: + optional_params[v.name] = v.default + else: + positional_params.append(v.name) + ground_truth_positional_params = [ + "cmd", + "client", + "resource_group_name", + "cluster_name", + "nodepool_name", + ] + self.assertEqual(positional_params, ground_truth_positional_params) + + # prepare a dictionary of default parameters + raw_param_dict = { + "resource_group_name": "test_rg_name", + "cluster_name": "test_cluster_name", + "nodepool_name": "test_nodepool_name", + } + raw_param_dict.update(optional_params) + + # default value in `aks_create` + dec_1 = AKSPreviewAgentPoolUpdateDecorator( + self.cmd, + self.client, + raw_param_dict, + self.resource_type, + self.agentpool_decorator_mode, + ) + self.client.get = Mock( + return_value=self.create_initialized_agentpool_instance(nodepool_name="test_nodepool_name") + ) + dec_agentpool_1 = dec_1.update_agentpool_profile_preview() + ground_truth_agentpool_1 = self.create_initialized_agentpool_instance( + nodepool_name="test_nodepool_name", + ) + self.assertEqual(dec_agentpool_1, ground_truth_agentpool_1) + + dec_1.context.raw_param.print_usage_statistics() + + +class AKSPreviewAgentPoolUpdateDecoratorManagedClusterModeTestCase(AKSPreviewAgentPoolUpdateDecoratorCommonTestCase): + def setUp(self): + # manually register CUSTOM_MGMT_AKS_PREVIEW + register_aks_preview_resource_type() + self.cli_ctx = MockCLI() + self.cmd = MockCmd(self.cli_ctx) + self.resource_type = CUSTOM_MGMT_AKS_PREVIEW + self.agentpool_decorator_mode = AgentPoolDecoratorMode.MANAGED_CLUSTER + self.models = AKSPreviewAgentPoolModels(self.cmd, self.resource_type, self.agentpool_decorator_mode) + self.client = MockClient() + + def test_update_agentpool_profile_preview(self): + import inspect + + from azure.cli.command_modules.acs.custom import aks_update + + optional_params = {} + positional_params = [] + for _, v in inspect.signature(aks_update).parameters.items(): + if v.default != v.empty: + optional_params[v.name] = v.default + else: + positional_params.append(v.name) + ground_truth_positional_params = [ + "cmd", + "client", + "resource_group_name", + "name", + ] + self.assertEqual(positional_params, ground_truth_positional_params) + + # prepare a dictionary of default parameters + raw_param_dict = { + "resource_group_name": "test_rg_name", + "name": "test_cluster_name", + } + raw_param_dict.update(optional_params) + + # default value in `aks_create` + dec_1 = AKSPreviewAgentPoolUpdateDecorator( + self.cmd, + self.client, + raw_param_dict, + self.resource_type, + self.agentpool_decorator_mode, + ) + agentpools = [ + self.create_initialized_agentpool_instance(nodepool_name="test_nodepool_1"), + self.create_initialized_agentpool_instance(nodepool_name="test_nodepool_2"), + ] + dec_agentpool_1 = dec_1.update_agentpool_profile_preview(agentpools) + ground_truth_agentpool_1 = self.create_initialized_agentpool_instance( + nodepool_name="test_nodepool_1", + ) + self.assertEqual(dec_agentpool_1, ground_truth_agentpool_1) + + dec_1.context.raw_param.print_usage_statistics() + + +if __name__ == "__main__": + unittest.main() diff --git a/src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py b/src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py index dda96e47b99..635bed89a3c 100644 --- a/src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py +++ b/src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py @@ -3265,7 +3265,17 @@ def test_check_raw_parameters(self): CUSTOM_MGMT_AKS_PREVIEW, ) # fail on no updated parameter provided - with self.assertRaises(RequiredArgumentMissingError): + with patch( + "azext_aks_preview.decorator.prompt_y_n", + return_value=False, + ),self.assertRaises(RequiredArgumentMissingError): + dec_1.check_raw_parameters() + + # unless user says they want to reconcile + with patch( + "azext_aks_preview.decorator.prompt_y_n", + return_value=True, + ): dec_1.check_raw_parameters() # custom value diff --git a/src/aks-preview/azext_aks_preview/tests/latest/utils.py b/src/aks-preview/azext_aks_preview/tests/latest/utils.py new file mode 100644 index 00000000000..5871a469b84 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/tests/latest/utils.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. +# -------------------------------------------------------------------------------------------- + +import os +import platform +import shutil +import tempfile + + +def get_test_data_file_path(filename): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + return os.path.join(curr_dir, "data", filename) diff --git a/src/aks-preview/setup.py b/src/aks-preview/setup.py index 315922dcec5..4292b77c0b4 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.65" +VERSION = "0.5.66" CLASSIFIERS = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", diff --git a/src/connectedmachine/HISTORY.rst b/src/connectedmachine/HISTORY.rst index 021ed70aa99..e47baac0cf3 100644 --- a/src/connectedmachine/HISTORY.rst +++ b/src/connectedmachine/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.5.0 ++++++ +* Upgrade the API version to stable/2022-03-10 + 0.4.1 +++++ * Add the enable-auto-upgrade parameter in az connectedmachine extension create/update functions diff --git a/src/connectedmachine/azext_connectedmachine/generated/_help.py b/src/connectedmachine/azext_connectedmachine/generated/_help.py index 224c2c3b301..2dbad11bbd2 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/_help.py +++ b/src/connectedmachine/azext_connectedmachine/generated/_help.py @@ -90,8 +90,7 @@ - name: Create or Update a Machine Extension text: |- az connectedmachine extension create --name "CustomScriptExtension" --location "eastus2euap" --type \ -"CustomScriptExtension" --publisher "Microsoft.Compute" --settings "{\\"commandToExecute\\":\\"powershell.exe -c \ -\\\\\\"Get-Process | Where-Object { $_.CPU -gt 10000 }\\\\\\"\\"}" --type-handler-version "1.10" --machine-name \ +"CustomScriptExtension" --publisher "Microsoft.Compute" --settings '{\"commandToExecute\":\"hostname\"}' --type-handler-version "1.10" --machine-name \ "myMachine" --resource-group "myResourceGroup" """ @@ -102,8 +101,7 @@ - name: Create or Update a Machine Extension text: |- az connectedmachine extension update --name "CustomScriptExtension" --type "CustomScriptExtension" \ ---publisher "Microsoft.Compute" --settings "{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | \ -Where-Object { $_.CPU -lt 100 }\\\\\\"\\"}" --type-handler-version "1.10" --machine-name "myMachine" --resource-group \ +--publisher "Microsoft.Compute" --settings '{\"commandToExecute\":\"hostname\"}' --type-handler-version "1.10" --machine-name "myMachine" --resource-group \ "myResourceGroup" """ @@ -141,8 +139,8 @@ examples: - name: Upgrade Machine Extensions text: |- - az connectedmachine upgrade-extension --extension-targets "{\\"Microsoft.Azure.Monitoring\\":{\\"targetV\ -ersion\\":\\"2.0\\"},\\"Microsoft.Compute.CustomScriptExtension\\":{\\"targetVersion\\":\\"1.10\\"}}" --machine-name \ + az connectedmachine upgrade-extension --extension-targets '{\"Microsoft.Azure.Monitoring\":{\"targetV\ +ersion\":\"2.0\"},\"Microsoft.Compute.CustomScriptExtension\":{\"targetVersion\":\"1.10\"}}' --machine-name \ "myMachine" --resource-group "myResourceGroup" """ diff --git a/src/connectedmachine/azext_connectedmachine/generated/_params.py b/src/connectedmachine/azext_connectedmachine/generated/_params.py index d803ca33c8d..f689d6708ec 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/_params.py +++ b/src/connectedmachine/azext_connectedmachine/generated/_params.py @@ -34,38 +34,38 @@ def load_arguments(self, _): with self.argument_context('connectedmachine show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], type=str, help='The name of the ' + c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], help='The name of the ' 'hybrid machine.', id_part='name') with self.argument_context('connectedmachine delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], type=str, help='The name of the ' + c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], help='The name of the ' 'hybrid machine.', id_part='name') with self.argument_context('connectedmachine extension list') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', type=str, help='The name of the machine containing the extension.') - c.argument('expand', type=str, help='The expand expression to apply on the operation.') + c.argument('machine_name', help='The name of the machine containing the extension.') + c.argument('expand', help='The expand expression to apply on the operation.') with self.argument_context('connectedmachine extension show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', type=str, help='The name of the machine containing the extension.', id_part='name') - c.argument('name', type=str, help='The name of the machine extension.', id_part='child_name_1') + c.argument('machine_name', help='The name of the machine containing the extension.', id_part='name') + c.argument('name', help='The name of the machine extension.', id_part='child_name_1') with self.argument_context('connectedmachine extension create') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', type=str, help='The name of the machine where the extension should be created or ' + c.argument('machine_name', help='The name of the machine where the extension should be created or ' 'updated.') - c.argument('name', type=str, help='The name of the machine extension.') + c.argument('name', help='The name of the machine extension.') c.argument('tags', tags_type) c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, validator=get_default_location_from_resource_group) - c.argument('force_update_tag', type=str, help='How the extension handler should be forced to update even if ' + c.argument('force_update_tag', help='How the extension handler should be forced to update even if ' 'the extension configuration has not changed.') c.argument('publisher', type=str, help='The name of the extension handler publisher.') - c.argument('type_', options_list=['--type'], type=str, help='Specifies the type of the extension; an example ' + c.argument('type_', options_list=['--type'], help='Specify the type of the extension; an example ' 'is "CustomScriptExtension".') - c.argument('type_handler_version', type=str, help='Specifies the version of the script handler.') + c.argument('type_handler_version', type=str, help='Specify the version of the script handler.') c.argument('enable_auto_upgrade', arg_type=get_three_state_flag(), help='Indicate whether the extension ' 'should be automatically upgraded by the platform if there is a newer version available.') c.argument('auto_upgrade_minor', arg_type=get_three_state_flag(), help='Indicate whether the extension should ' @@ -76,24 +76,24 @@ def load_arguments(self, _): c.argument('protected_settings', type=validate_file_or_dict, help='The extension can contain either ' 'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected ' 'value: json-string/json-file/@json-file.') - c.argument('instance_view_type', type=str, help='Specify the type of the extension; an example is ' + c.argument('instance_view_type', help='Specify the type of the extension; an example is ' '"CustomScriptExtension".', arg_group='Instance View') - c.argument('inst_handler_version', type=str, help='Specify the version of the script handler.', + c.argument('inst_handler_version', help='Specify the version of the script handler.', arg_group='Instance View') c.argument('status', action=AddStatus, nargs='+', help='Instance view status.', arg_group='Instance View') with self.argument_context('connectedmachine extension update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', type=str, help='The name of the machine where the extension should be created or ' + c.argument('machine_name', help='The name of the machine where the extension should be created or ' 'updated.', id_part='name') - c.argument('name', type=str, help='The name of the machine extension.', id_part='child_name_1') + c.argument('name', help='The name of the machine extension.', id_part='child_name_1') c.argument('tags', tags_type) - c.argument('force_update_tag', type=str, help='How the extension handler should be forced to update even if ' + c.argument('force_update_tag', help='How the extension handler should be forced to update even if ' 'the extension configuration has not changed.') - c.argument('publisher', type=str, help='The name of the extension handler publisher.') - c.argument('type_', options_list=['--type'], type=str, help='Specifies the type of the extension; an example ' + c.argument('publisher', help='The name of the extension handler publisher.') + c.argument('type_', options_list=['--type'], help='Specify the type of the extension; an example ' 'is "CustomScriptExtension".') - c.argument('type_handler_version', type=str, help='Specifies the version of the script handler.') + c.argument('type_handler_version', help='Specify the version of the script handler.') c.argument('enable_auto_upgrade', arg_type=get_three_state_flag(), help='Indicate whether the extension ' 'should be automatically upgraded by the platform if there is a newer version available.') c.argument('auto_upgrade_minor', arg_type=get_three_state_flag(), help='Indicate whether the extension should ' @@ -107,18 +107,18 @@ def load_arguments(self, _): with self.argument_context('connectedmachine extension delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', type=str, help='The name of the machine where the extension should be deleted.', + c.argument('machine_name', help='The name of the machine where the extension should be deleted.', id_part='name') - c.argument('name', type=str, help='The name of the machine extension.', id_part='child_name_1') + c.argument('name', help='The name of the machine extension.', id_part='child_name_1') with self.argument_context('connectedmachine extension wait') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', type=str, help='The name of the machine containing the extension.', id_part='name') - c.argument('name', type=str, help='The name of the machine extension.', id_part='child_name_1') + c.argument('machine_name', help='The name of the machine containing the extension.', id_part='name') + c.argument('name', help='The name of the machine extension.', id_part='child_name_1') with self.argument_context('connectedmachine upgrade-extension') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', type=str, help='The name of the hybrid machine.', id_part='name') + c.argument('machine_name', help='The name of the hybrid machine.', id_part='name') c.argument('extension_targets', type=validate_file_or_dict, help='Describe the Extension Target Properties. ' 'Expected value: json-string/json-file/@json-file.') @@ -127,12 +127,12 @@ def load_arguments(self, _): with self.argument_context('connectedmachine private-link-scope show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', id_part='name') with self.argument_context('connectedmachine private-link-scope create') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.') + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.') c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, validator=get_default_location_from_resource_group) c.argument('tags', tags_type) @@ -141,7 +141,7 @@ def load_arguments(self, _): with self.argument_context('connectedmachine private-link-scope update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', id_part='name') c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, validator=get_default_location_from_resource_group) @@ -152,76 +152,76 @@ def load_arguments(self, _): with self.argument_context('connectedmachine private-link-scope delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', id_part='name') with self.argument_context('connectedmachine private-link-scope show-validation-detail') as c: c.argument('location', arg_type=get_location_type(self.cli_ctx), id_part='name') - c.argument('private_link_scope_id', type=str, help='The id (Guid) of the Azure Arc PrivateLinkScope resource.', + c.argument('private_link_scope_id', help='The id (Guid) of the Azure Arc PrivateLinkScope resource.', id_part='child_name_1') with self.argument_context('connectedmachine private-link-scope show-validation-detail-for-machine') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', type=str, help='The name of the target machine to get the private link scope ' + c.argument('machine_name', help='The name of the target machine to get the private link scope ' 'validation details for.', id_part='name') with self.argument_context('connectedmachine private-link-scope update-tag') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', id_part='name') c.argument('tags', tags_type) with self.argument_context('connectedmachine private-link-scope wait') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', id_part='name') with self.argument_context('connectedmachine private-link-resource list') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.') + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.') with self.argument_context('connectedmachine private-link-resource show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', id_part='name') - c.argument('group_name', type=str, help='The name of the private link resource.', id_part='child_name_1') + c.argument('group_name', help='The name of the private link resource.', id_part='child_name_1') with self.argument_context('connectedmachine private-endpoint-connection list') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.') + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.') with self.argument_context('connectedmachine private-endpoint-connection show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', id_part='name') c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' - 'e'], type=str, help='The name of the private ' + 'e'], help='The name of the private ' 'endpoint connection.', id_part='child_name_1') with self.argument_context('connectedmachine private-endpoint-connection update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', id_part='name') c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' - 'e'], type=str, help='The name of the private ' + 'e'], help='The name of the private ' 'endpoint connection.', id_part='child_name_1') c.argument('connection_state', action=AddConnectionState, nargs='+', help='Connection state of the private ' 'endpoint connection.') - c.argument('id_', options_list=['--id'], type=str, help='Resource id of the private endpoint.', + c.argument('id_', options_list=['--id'], help='Resource id of the private endpoint.', arg_group='Private Endpoint') with self.argument_context('connectedmachine private-endpoint-connection delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', id_part='name') c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' - 'e'], type=str, help='The name of the private ' + 'e'], help='The name of the private ' 'endpoint connection.', id_part='child_name_1') with self.argument_context('connectedmachine private-endpoint-connection wait') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', id_part='name') c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' - 'e'], type=str, help='The name of the private ' + 'e'], help='The name of the private ' 'endpoint connection.', id_part='child_name_1') diff --git a/src/connectedmachine/azext_connectedmachine/generated/custom.py b/src/connectedmachine/azext_connectedmachine/generated/custom.py index 749a679b786..55c7a672c0b 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/custom.py +++ b/src/connectedmachine/azext_connectedmachine/generated/custom.py @@ -7,7 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: disable=line-too-long # pylint: disable=too-many-lines # pylint: disable=unused-argument @@ -73,22 +72,36 @@ def connectedmachine_extension_create(client, status=None, no_wait=False): extension_parameters = {} - extension_parameters['tags'] = tags + if tags is not None: + extension_parameters['tags'] = tags extension_parameters['location'] = location extension_parameters['properties'] = {} - extension_parameters['properties']['force_update_tag'] = force_update_tag - extension_parameters['properties']['publisher'] = publisher - extension_parameters['properties']['type'] = type_ - extension_parameters['properties']['type_handler_version'] = type_handler_version - extension_parameters['properties']['enable_auto_upgrade'] = enable_auto_upgrade - extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor - extension_parameters['properties']['settings'] = settings - extension_parameters['properties']['protected_settings'] = protected_settings + if force_update_tag is not None: + extension_parameters['properties']['force_update_tag'] = force_update_tag + if publisher is not None: + extension_parameters['properties']['publisher'] = publisher + if type_ is not None: + extension_parameters['properties']['type'] = type_ + if type_handler_version is not None: + extension_parameters['properties']['type_handler_version'] = type_handler_version + if enable_auto_upgrade is not None: + extension_parameters['properties']['enable_automatic_upgrade'] = enable_auto_upgrade + if auto_upgrade_minor is not None: + extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor + if settings is not None: + extension_parameters['properties']['settings'] = settings + if protected_settings is not None: + extension_parameters['properties']['protected_settings'] = protected_settings extension_parameters['properties']['instance_view'] = {} extension_parameters['properties']['instance_view']['name'] = name - extension_parameters['properties']['instance_view']['type'] = instance_view_type - extension_parameters['properties']['instance_view']['type_handler_version'] = inst_handler_version - extension_parameters['properties']['instance_view']['status'] = status + if instance_view_type is not None: + extension_parameters['properties']['instance_view']['type'] = instance_view_type + if inst_handler_version is not None: + extension_parameters['properties']['instance_view']['type_handler_version'] = inst_handler_version + if status is not None: + extension_parameters['properties']['instance_view']['status'] = status + if len(extension_parameters['properties']['instance_view']) == 0: + del extension_parameters['properties']['instance_view'] return sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name=resource_group_name, @@ -106,22 +119,30 @@ def connectedmachine_extension_update(client, publisher=None, type_=None, type_handler_version=None, - enable_auto_upgrade=None, auto_upgrade_minor=None, settings=None, protected_settings=None, no_wait=False): extension_parameters = {} - extension_parameters['tags'] = tags + if tags is not None: + extension_parameters['tags'] = tags extension_parameters['properties'] = {} - extension_parameters['properties']['force_update_tag'] = force_update_tag - extension_parameters['properties']['publisher'] = publisher - extension_parameters['properties']['type'] = type_ - extension_parameters['properties']['type_handler_version'] = type_handler_version - extension_parameters['properties']['enable_auto_upgrade'] = enable_auto_upgrade - extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor - extension_parameters['properties']['settings'] = settings - extension_parameters['properties']['protected_settings'] = protected_settings + if force_update_tag is not None: + extension_parameters['properties']['force_update_tag'] = force_update_tag + if publisher is not None: + extension_parameters['properties']['publisher'] = publisher + if type_ is not None: + extension_parameters['properties']['type'] = type_ + if type_handler_version is not None: + extension_parameters['properties']['type_handler_version'] = type_handler_version + if auto_upgrade_minor is not None: + extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor + if settings is not None: + extension_parameters['properties']['settings'] = settings + if protected_settings is not None: + extension_parameters['properties']['protected_settings'] = protected_settings + if len(extension_parameters['properties']) == 0: + del extension_parameters['properties'] return sdk_no_wait(no_wait, client.begin_update, resource_group_name=resource_group_name, @@ -147,7 +168,8 @@ def connectedmachine_upgrade_extension(client, machine_name, extension_targets=None): extension_upgrade_parameters = {} - extension_upgrade_parameters['extension_targets'] = extension_targets + if extension_targets is not None: + extension_upgrade_parameters['extension_targets'] = extension_targets return client.begin_upgrade_extensions(resource_group_name=resource_group_name, machine_name=machine_name, extension_upgrade_parameters=extension_upgrade_parameters) @@ -173,13 +195,17 @@ def connectedmachine_private_link_scope_create(client, location, tags=None, public_network_access=None): - if public_network_access is None: - public_network_access = "Disabled" parameters = {} parameters['location'] = location - parameters['tags'] = tags + if tags is not None: + parameters['tags'] = tags parameters['properties'] = {} - parameters['properties']['public_network_access'] = "Disabled" if public_network_access is None else public_network_access + if public_network_access is not None: + parameters['properties']['public_network_access'] = public_network_access + else: + parameters['properties']['public_network_access'] = "Disabled" + if len(parameters['properties']) == 0: + del parameters['properties'] return client.create_or_update(resource_group_name=resource_group_name, scope_name=scope_name, parameters=parameters) @@ -191,14 +217,11 @@ def connectedmachine_private_link_scope_update(instance, location, tags=None, public_network_access=None): - if public_network_access is None: - public_network_access = "Disabled" - if location is not None: - instance.location = location + instance.location = location if tags is not None: instance.tags = tags if public_network_access is not None: - instance.properties.public_network_access = "Disabled" if public_network_access is None else public_network_access + instance.properties.public_network_access = public_network_access return instance @@ -231,7 +254,8 @@ def connectedmachine_private_link_scope_update_tag(client, scope_name, tags=None): private_link_scope_tags = {} - private_link_scope_tags['tags'] = tags + if tags is not None: + private_link_scope_tags['tags'] = tags return client.update_tags(resource_group_name=resource_group_name, scope_name=scope_name, private_link_scope_tags=private_link_scope_tags) @@ -278,9 +302,13 @@ def connectedmachine_private_endpoint_connection_update(client, no_wait=False): parameters = {} parameters['properties'] = {} - parameters['properties']['private_link_service_connection_state'] = connection_state + if connection_state is not None: + parameters['properties']['private_link_service_connection_state'] = connection_state parameters['properties']['private_endpoint'] = {} - parameters['properties']['private_endpoint']['id'] = id_ + if id_ is not None: + parameters['properties']['private_endpoint']['id'] = id_ + if len(parameters['properties']['private_endpoint']) == 0: + del parameters['properties']['private_endpoint'] return sdk_no_wait(no_wait, client.begin_update, resource_group_name=resource_group_name, diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/example_steps.py b/src/connectedmachine/azext_connectedmachine/tests/latest/example_steps.py index a2ab11a6eb0..d050095ac09 100644 --- a/src/connectedmachine/azext_connectedmachine/tests/latest/example_steps.py +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/example_steps.py @@ -11,13 +11,6 @@ from .. import try_manual -MACHINE_NAME = 'sdkTestVM' -RESOURCE_GROUP = 'az-sdk-test' -LOCATION = 'eastus2euap' -EXTENSION_NAME = 'CustomScriptExtension' -SCOPE_NAME = '' -PRIVATE_ENDPOINT_NAME = '' - # EXAMPLE: /Machines/get/Get Machine @try_manual @@ -25,8 +18,8 @@ def step_show(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine show ' - f'--name "{MACHINE_NAME}" ' - f'--resource-group "{RESOURCE_GROUP}"', + '--name "{myMachine}" ' + '--resource-group "{rg}"', checks=checks) @@ -36,7 +29,20 @@ def step_list(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine list ' - f'--resource-group "{RESOURCE_GROUP}"', + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /connectedmachine/post/Upgrade Machine Extensions +@try_manual +def step_upgrade_extension(test, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine upgrade-extension ' + '--extension-targets "{{\\"Microsoft.Azure.Monitoring\\":{{\\"targetVersion\\":\\"2.0\\"}},\\"Microsoft.Co' + 'mpute.CustomScriptExtension\\":{{\\"targetVersion\\":\\"1.10\\"}}}}" ' + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', checks=checks) @@ -48,14 +54,13 @@ def step_extension_create(test, checks=None): test.cmd('az connectedmachine extension create ' '--name "CustomScriptExtension" ' '--location "eastus2euap" ' - '--enable-auto-upgrade true ' '--type "CustomScriptExtension" ' '--publisher "Microsoft.Compute" ' '--settings "{{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | Where-Object {{{{ $_.CPU ' '-gt 10000 }}}}\\\\\\"\\"}}" ' - '--type-handler-version "1.10.10" ' - f'--machine-name "{MACHINE_NAME}" ' - f'--resource-group "{RESOURCE_GROUP}"', + '--type-handler-version "1.10" ' + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', checks=checks) @@ -65,8 +70,8 @@ def step_extension_list(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine extension list ' - f'--machine-name "{MACHINE_NAME}" ' - f'--resource-group "{RESOURCE_GROUP}"', + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', checks=checks) @@ -76,21 +81,9 @@ def step_extension_show(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine extension show ' - f'--name "CustomScriptExtension" ' - f'--machine-name "{MACHINE_NAME}" ' - f'--resource-group "{RESOURCE_GROUP}"', - checks=checks) - - -# EXAMPLE: /connectedmachine/post/Upgrade Machine Extensions -@try_manual -def step_upgrade_extension(test, checks=None): - if checks is None: - checks = [] - test.cmd('az connectedmachine upgrade-extension ' - '--extension-targets "{{\\"Microsoft.Compute.CustomScriptExtension\\":{{\\"targetVersion\\":\\"1.10.12\\"}}}}" ' - f'--machine-name "{MACHINE_NAME}" ' - f'--resource-group "{RESOURCE_GROUP}"', + '--name "CustomScriptExtension" ' + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', checks=checks) @@ -100,12 +93,15 @@ def step_extension_update(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine extension update ' - f'--name "{EXTENSION_NAME}" ' - '--enable-auto-upgrade false ' - '--settings "{{\\"commandToExecute\\":\\"hostname\\"}}" ' - f'--machine-name "{MACHINE_NAME}" ' - f'--resource-group "{RESOURCE_GROUP}"', - checks=checks) + '--name "CustomScriptExtension" ' + '--type "CustomScriptExtension" ' + '--publisher "Microsoft.Compute" ' + '--settings "{{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | Where-Object {{{{ $_.CPU ' + '-lt 100 }}}}\\\\\\"\\"}}" ' + '--type-handler-version "1.10" ' + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', + checks=checks) # EXAMPLE: /MachineExtensions/delete/Delete a Machine Extension @@ -114,9 +110,9 @@ def step_extension_delete(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine extension delete -y ' - f'--name "{EXTENSION_NAME}" ' - f'--machine-name "{MACHINE_NAME}" ' - f'--resource-group "{RESOURCE_GROUP}"', + '--name "MMA" ' + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', checks=checks) @@ -126,8 +122,8 @@ def step_delete(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine delete -y ' - f'--name "{MACHINE_NAME}" ' - f'--resource-group "{RESOURCE_GROUP}"', + '--name "{myMachine}" ' + '--resource-group "{rg}"', checks=checks) @@ -138,10 +134,15 @@ def step_private_endpoint_connection_update(test, checks=None): checks = [] test.cmd('az connectedmachine private-endpoint-connection update ' '--connection-state description="Approved by johndoe@contoso.com" status="Approved" ' - f'--name "{PRIVATE_ENDPOINT_NAME}" ' - f'--resource-group "{RESOURCE_GROUP}" ' - f'--scope-name "{SCOPE_NAME}"', + '--name "{myPrivateEndpointConnection}" ' + '--resource-group "{rg}" ' + '--scope-name "myPrivateLinkScope"', checks=[]) + test.cmd('az connectedmachine private-endpoint-connection wait --created ' + '--name "{myPrivateEndpointConnection}" ' + '--resource-group "{rg}" ' + '--scope-name "myPrivateLinkScope"', + checks=checks) # EXAMPLE: /PrivateEndpointConnections/get/Gets list of private endpoint connections on a private link scope. @@ -150,8 +151,8 @@ def step_private_endpoint_connection_list(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine private-endpoint-connection list ' - f'--resource-group "{RESOURCE_GROUP}" ' - f'--scope-name "{SCOPE_NAME}"', + '--resource-group "{rg}" ' + '--scope-name "myPrivateLinkScope"', checks=checks) @@ -161,9 +162,9 @@ def step_private_endpoint_connection_show(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine private-endpoint-connection show ' - f'--name "{PRIVATE_ENDPOINT_NAME}" ' - f'--resource-group "{RESOURCE_GROUP}" ' - f'--scope-name "{SCOPE_NAME}"', + '--name "{myPrivateEndpointConnection}" ' + '--resource-group "{rg}" ' + '--scope-name "myPrivateLinkScope"', checks=checks) @@ -173,9 +174,9 @@ def step_private_endpoint_connection_delete(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine private-endpoint-connection delete -y ' - f'--name "{PRIVATE_ENDPOINT_NAME}" ' - f'--resource-group "{RESOURCE_GROUP}" ' - f'--scope-name "{SCOPE_NAME}"', + '--name "{myPrivateEndpointConnection}" ' + '--resource-group "{rg}" ' + '--scope-name "myPrivateLinkScope"', checks=checks) @@ -185,8 +186,8 @@ def step_private_link_resource_list(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine private-link-resource list ' - f'--resource-group "{RESOURCE_GROUP}" ' - f'--scope-name "{SCOPE_NAME}"', + '--resource-group "{rg}" ' + '--scope-name "myPrivateLinkScope"', checks=checks) @@ -196,9 +197,9 @@ def step_private_link_scope_create(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine private-link-scope create ' - f'--location "{LOCATION}" ' - f'--resource-group "{RESOURCE_GROUP}" ' - f'--scope-name "{SCOPE_NAME}"', + '--location "westus" ' + '--resource-group "{rg_2}" ' + '--scope-name "my-privatelinkscope"', checks=checks) @@ -208,11 +209,10 @@ def step_private_link_scope_update(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine private-link-scope update ' - f'--location "{LOCATION}" ' + '--location "westus" ' '--tags Tag1="Value1" ' - '--public-network-access Enabled ' - f'--resource-group "{RESOURCE_GROUP}" ' - f'--scope-name "{SCOPE_NAME}"', + '--resource-group "{rg_2}" ' + '--scope-name "my-privatelinkscope"', checks=checks) @@ -222,8 +222,8 @@ def step_private_link_scope_show(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine private-link-scope show ' - f'--resource-group "{RESOURCE_GROUP}" ' - f'--scope-name "{SCOPE_NAME}"', + '--resource-group "{rg_2}" ' + '--scope-name "my-privatelinkscope"', checks=checks) @@ -233,7 +233,17 @@ def step_private_link_scope_list(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine private-link-scope list ' - f'--resource-group "{RESOURCE_GROUP}"', + '--resource-group "{rg_2}"', + checks=checks) + + +# EXAMPLE: /PrivateLinkScopes/get/PrivateLinkScopesList.json +@try_manual +def step_private_link_scope_list2(test, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-link-scope list ' + '-g ""', checks=checks) @@ -244,8 +254,8 @@ def step_private_link_scope_update_tag(test, checks=None): checks = [] test.cmd('az connectedmachine private-link-scope update-tag ' '--tags Tag1="Value1" Tag2="Value2" ' - f'--resource-group "{RESOURCE_GROUP}" ' - f'--scope-name "{SCOPE_NAME}"', + '--resource-group "{rg_2}" ' + '--scope-name "my-privatelinkscope"', checks=checks) @@ -255,6 +265,6 @@ def step_private_link_scope_delete(test, checks=None): if checks is None: checks = [] test.cmd('az connectedmachine private-link-scope delete -y ' - f'--resource-group "{RESOURCE_GROUP}" ' - f'--scope-name "{SCOPE_NAME}"', + '--resource-group "{rg_2}" ' + '--scope-name "my-privatelinkscope"', checks=checks) diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_ConnectedMachineAndExtension_Scenario.yaml b/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_ConnectedMachineAndExtension_Scenario.yaml new file mode 100644 index 00000000000..f6ed2337052 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_ConnectedMachineAndExtension_Scenario.yaml @@ -0,0 +1,789 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine?api-version=2022-03-10&$expand=instanceView + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine","name":"testMachine","location":"eastus2euap","tags":{},"identity":{"type":"SystemAssigned","principalId":"2fe4f9c6-056c-48b2-a19e-4e38b92beab1","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"type":"Microsoft.HybridCompute/machines","properties":{"provisioningState":"Succeeded","agentVersion":"1.17.01931.201","status":"Connected","lastStatusChange":"2022-05-06T08:17:18.9085464Z","errorDetails":[],"displayName":"DorothysSurface","machineFqdn":"DorothysSurface","osName":"windows","osVersion":"10.0.19044.1645","osType":"windows","osProfile":{"computerName":"DorothysSurface"},"vmId":"785cbd31-2e8d-4b9c-aa40-5e0739467f3e","vmUuid":"2883CCA3-7EE6-60E9-A204-97718B655D1D","clientPublicKey":"MIIBCgKCAQEAu3/aWoSctGo/S0EN4+SSFbF2ObovVy6F/d8KUQ98fJjfXYYv2lMPoCGBM1sru36dsey+iyRxkLJgr09HUAj0WxsjV4BFyIkpCdvcCl5C4K37cABX57a9B73XeD5fKlQeErLoCVxT/lY5Vl/buy0tOAorA/VW5RZxqkHR7YzxFTrMNCMxVpzABVqMgo60hYqSraxVq+MJB+1Ea0VDSQ7OIimRwRvsH6GcGbRXTXKSpDQeeotU3krOEUmGtld/6RGA1eTc7aodVfwPGMUWyIHb0u5klHhaaNfhZPBBo7TMsxnMvbFCCPgDOplf21e8nZ+5MD6Vqz8K/4KuZiVoV/W5EQIDAQAB","osSku":"Windows + 10 Enterprise","domainName":"WORKGROUP","adFqdn":"DorothysSurface","dnsFqdn":"DorothysSurface","mssqlDiscovered":"false","cloudMetadata":{"provider":"N/A"},"detectedProperties":{"cloudprovider":"N/A","manufacturer":"Microsoft + Corporation","model":"Surface Book 2","mssqldiscovered":"false"},"agentConfiguration":{"proxyUrl":"","incomingConnectionsPorts":[],"extensionsAllowList":[],"extensionsBlockList":[],"proxyBypass":[],"extensionsEnabled":"true","guestConfigurationEnabled":"true"},"serviceStatuses":{"extensionService":{"status":"running","startupType":"automatic"},"guestConfigurationService":{"status":"running","startupType":"automatic"}}},"resources":[]}' + headers: + cache-control: + - no-cache + content-length: + - '1882' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 08:31:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines?api-version=2022-03-10 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine","name":"testMachine","location":"eastus2euap","tags":{},"identity":{"type":"SystemAssigned","principalId":"2fe4f9c6-056c-48b2-a19e-4e38b92beab1","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"type":"Microsoft.HybridCompute/machines","properties":{"provisioningState":"Succeeded","agentVersion":"1.17.01931.201","status":"Connected","lastStatusChange":"2022-05-06T08:17:18.9085464Z","errorDetails":[],"displayName":"DorothysSurface","machineFqdn":"DorothysSurface","osName":"windows","osVersion":"10.0.19044.1645","osType":"windows","osProfile":{"computerName":"DorothysSurface"},"vmId":"785cbd31-2e8d-4b9c-aa40-5e0739467f3e","vmUuid":"2883CCA3-7EE6-60E9-A204-97718B655D1D","clientPublicKey":"MIIBCgKCAQEAu3/aWoSctGo/S0EN4+SSFbF2ObovVy6F/d8KUQ98fJjfXYYv2lMPoCGBM1sru36dsey+iyRxkLJgr09HUAj0WxsjV4BFyIkpCdvcCl5C4K37cABX57a9B73XeD5fKlQeErLoCVxT/lY5Vl/buy0tOAorA/VW5RZxqkHR7YzxFTrMNCMxVpzABVqMgo60hYqSraxVq+MJB+1Ea0VDSQ7OIimRwRvsH6GcGbRXTXKSpDQeeotU3krOEUmGtld/6RGA1eTc7aodVfwPGMUWyIHb0u5klHhaaNfhZPBBo7TMsxnMvbFCCPgDOplf21e8nZ+5MD6Vqz8K/4KuZiVoV/W5EQIDAQAB","osSku":"Windows + 10 Enterprise","domainName":"WORKGROUP","adFqdn":"DorothysSurface","dnsFqdn":"DorothysSurface","mssqlDiscovered":"false","cloudMetadata":{"provider":"N/A"},"detectedProperties":{"cloudprovider":"N/A","manufacturer":"Microsoft + Corporation","model":"Surface Book 2","mssqldiscovered":"false"},"agentConfiguration":{"proxyUrl":"","incomingConnectionsPorts":[],"extensionsAllowList":[],"extensionsBlockList":[],"proxyBypass":[],"extensionsEnabled":"true","guestConfigurationEnabled":"true"},"serviceStatuses":{"extensionService":{"status":"running","startupType":"automatic"},"guestConfigurationService":{"status":"running","startupType":"automatic"}}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/dorothylinux2-Virtual-Machine","name":"dorothylinux2-Virtual-Machine","location":"eastus2euap","tags":{},"identity":{"type":"SystemAssigned","principalId":"5ce02094-bd55-44ba-b1e4-2d56b6a6ba69","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"type":"Microsoft.HybridCompute/machines","properties":{"provisioningState":"Succeeded","agentVersion":"1.7.21162.005","status":"Expired","lastStatusChange":"2021-09-30T06:14:01.8555779Z","errorDetails":[],"displayName":"dorothylinux2-Virtual-Machine","machineFqdn":"dorothylinux2-Virtual-Machine","osName":"linux","osVersion":"5.8.0-59-generic","osType":"linux","osProfile":{"computerName":"dorothylinux2-Virtual-Machine","linuxConfiguration":{"patchSettings":{"assessmentMode":"null"}}},"vmId":"8948ef10-f369-471d-b363-8e2ff44614ca","vmUuid":"80f26cf0-d9a7-4637-a2ff-587bd51626fc","clientPublicKey":"MIIBCgKCAQEAukhdoNaMfaHRGP6MvgdWdyefHdET/mV0J3NdpMU+LFRE5IWwZxG+mGOb2lK3dsgX6HenWyRiumC2BMDX6RuLfRuscZw+HT/W4W/9ScDxbD18o4vECD7DmiFmIs4iPaF8GLTjO2fJzjAl59k7nblfr38SexA8EKo5WqG2LFhbT6CAXtBMPtWebWeZCQ3uXCri8838nDtqhQtqY6Efg4A2sEV9s4Mk7LjINpzcVuPYdvxcFngM22hixUawE9GH8UKIV5XF+/c8xk1b1fvUGizf+sNbgSMZFyJ3Vgg5ne5ibepxyR3WBtmvd3L/mF1negSh/5h9QQKTt7djeUYCb+ztjwIDAQAB","osSku":"Ubuntu + 20.04 LTS","domainName":"unknown","adFqdn":"unknown","dnsFqdn":"dorothylinux2-Virtual-Machine","mssqlDiscovered":"false","detectedProperties":{"cloudprovider":"N/A","manufacturer":"Microsoft + Corporation","model":"Virtual Machine","mssqldiscovered":"false"},"agentConfiguration":{}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '3516' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 08:31:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "properties": {"publisher": "Microsoft.Compute", + "type": "CustomScriptExtension", "typeHandlerVersion": "1.10.10", "enableAutomaticUpgrade": + true, "settings": {"commandToExecute": "hostname"}, "instanceView": {"name": + "custom-000001"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension create + Connection: + - keep-alive + Content-Length: + - '264' + Content-Type: + - application/json + ParameterSetName: + - --name --location --enable-auto-upgrade --type --publisher --type-handler-version + --machine-name --resource-group --settings + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/e229b954-5145-4d75-9a0f-4b3994d2efb8?api-version=2022-03-10 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Fri, 06 May 2022 08:31:50 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/e229b954-5145-4d75-9a0f-4b3994d2efb8?api-version=2022-03-10 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '319' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension create + Connection: + - keep-alive + ParameterSetName: + - --name --location --enable-auto-upgrade --type --publisher --type-handler-version + --machine-name --resource-group --settings + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/e229b954-5145-4d75-9a0f-4b3994d2efb8?api-version=2022-03-10 + response: + body: + string: '{"name":"e229b954-5145-4d75-9a0f-4b3994d2efb8","status":"Succeeded","startTime":"2022-05-06T08:31:51.1024586Z","properties":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension + Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}}' + headers: + cache-control: + - no-cache + content-length: + - '878' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 08:36:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension create + Connection: + - keep-alive + ParameterSetName: + - --name --location --enable-auto-upgrade --type --publisher --type-handler-version + --machine-name --resource-group --settings + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension + Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}' + headers: + cache-control: + - no-cache + content-length: + - '753' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 08:36:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension list + Connection: + - keep-alive + ParameterSetName: + - --machine-name -g + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions?api-version=2022-03-10 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension + Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '765' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 08:36:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension show + Connection: + - keep-alive + ParameterSetName: + - --name --machine-name --resource-group + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension + Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}' + headers: + cache-control: + - no-cache + content-length: + - '753' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 08:36:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"extensionTargets": {"Microsoft.Compute.CustomScriptExtension": {"targetVersion": + "1.10.12"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine upgrade-extension + Connection: + - keep-alive + Content-Length: + - '95' + Content-Type: + - application/json + ParameterSetName: + - --extension-targets --machine-name --resource-group + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/upgradeExtensions?api-version=2022-03-10 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/e272770b-81ea-4c02-b9c7-798c6ff63ec6?api-version=2022-03-10 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Fri, 06 May 2022 08:36:54 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/e272770b-81ea-4c02-b9c7-798c6ff63ec6?api-version=2022-03-10 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine upgrade-extension + Connection: + - keep-alive + ParameterSetName: + - --extension-targets --machine-name --resource-group + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/e272770b-81ea-4c02-b9c7-798c6ff63ec6?api-version=2022-03-10 + response: + body: + string: '{"name":"e272770b-81ea-4c02-b9c7-798c6ff63ec6","status":"Succeeded","startTime":"2022-05-06T08:36:55.0127616Z","properties":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension + Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '881' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 08:41:55 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine upgrade-extension + Connection: + - keep-alive + ParameterSetName: + - --extension-targets --machine-name --resource-group + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/e272770b-81ea-4c02-b9c7-798c6ff63ec6?api-version=2022-03-10 + response: + body: + string: '[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension + Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}]' + headers: + cache-control: + - no-cache + content-length: + - '756' + content-type: + - application/json + date: + - Fri, 06 May 2022 08:41:55 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"settings": {"commandToExecute": "dir"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension update + Connection: + - keep-alive + Content-Length: + - '57' + Content-Type: + - application/json + ParameterSetName: + - --name --settings --machine-name --resource-group + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/306d1c3c-84ea-4731-aee5-17b0bebb5b32?api-version=2022-03-10 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Fri, 06 May 2022 08:41:57 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/306d1c3c-84ea-4731-aee5-17b0bebb5b32?api-version=2022-03-10 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '319' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension update + Connection: + - keep-alive + ParameterSetName: + - --name --settings --machine-name --resource-group + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/306d1c3c-84ea-4731-aee5-17b0bebb5b32?api-version=2022-03-10 + response: + body: + string: '{"name":"306d1c3c-84ea-4731-aee5-17b0bebb5b32","status":"Succeeded","startTime":"2022-05-06T08:41:57.748299Z","properties":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"dir"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension + Message: Command execution finished, StdOut: Volume in drive C has no label.\r\n + Volume Serial Number is 867D-A9DE\r\n\r\n Directory of C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.12\\Downloads\\1\r\n\r\n05/06/2022 01:42 + AM .\r\n05/06/2022 01:42 AM ..\r\n 0 + File(s) 0 bytes\r\n 2 Dir(s) 298,947,067,904 bytes + free\r\n"}}}}}' + headers: + cache-control: + - no-cache + content-length: + - '1232' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 08:46:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension update + Connection: + - keep-alive + ParameterSetName: + - --name --settings --machine-name --resource-group + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"dir"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension + Message: Command execution finished, StdOut: Volume in drive C has no label.\r\n + Volume Serial Number is 867D-A9DE\r\n\r\n Directory of C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.12\\Downloads\\1\r\n\r\n05/06/2022 01:42 + AM .\r\n05/06/2022 01:42 AM ..\r\n 0 + File(s) 0 bytes\r\n 2 Dir(s) 298,947,067,904 bytes + free\r\n"}}}}' + headers: + cache-control: + - no-cache + content-length: + - '1108' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 08:46:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --machine-name --resource-group + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/4ae958b4-7eef-4ea2-bbde-dfb0df01373f?api-version=2022-03-10 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Fri, 06 May 2022 08:47:01 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/4ae958b4-7eef-4ea2-bbde-dfb0df01373f?api-version=2022-03-10 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension delete + Connection: + - keep-alive + ParameterSetName: + - -y --name --machine-name --resource-group + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/4ae958b4-7eef-4ea2-bbde-dfb0df01373f?api-version=2022-03-10 + response: + body: + string: '{"name":"4ae958b4-7eef-4ea2-bbde-dfb0df01373f","status":"Succeeded","startTime":"2022-05-06T08:47:01.3144714Z"}' + headers: + cache-control: + - no-cache + content-length: + - '111' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 08:52:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine?api-version=2022-03-10 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Fri, 06 May 2022 08:52:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_PrivateLinkAndPrivateEndpointConnection_Scenario.yaml b/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_PrivateLinkAndPrivateEndpointConnection_Scenario.yaml new file mode 100644 index 00000000000..fc89d35bd77 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_PrivateLinkAndPrivateEndpointConnection_Scenario.yaml @@ -0,0 +1,1537 @@ +interactions: +- request: + body: '{"location": "eastus2euap"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - group create + Connection: + - keep-alive + Content-Length: + - '27' + Content-Type: + - application/json + ParameterSetName: + - -n -l + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/az-sdk-test-000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001","name":"az-sdk-test-000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '238' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: '{"location": "eastus2euap", "tags": {}, "properties": {"addressSpace": + {"addressPrefixes": ["10.0.0.0/16"]}, "dhcpOptions": {}, "subnets": [{"name": + "subnet-000001", "properties": {"addressPrefix": "10.0.0.0/24", "privateEndpointNetworkPolicies": + "Enabled", "privateLinkServiceNetworkPolicies": "Enabled"}}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + Content-Length: + - '309' + Content-Type: + - application/json + ParameterSetName: + - -n -g -l --subnet-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000001\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001\",\r\n + \ \"etag\": \"W/\\\"d3030042-33cf-431a-a6d3-d261ae122bfb\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus2euap\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"63239842-bf65-4ea4-8a59-08ebf199380d\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000001\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001\",\r\n + \ \"etag\": \"W/\\\"d3030042-33cf-431a-a6d3-d261ae122bfb\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/88ce9056-4f48-452b-99c4-c3e524141cb0?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '1324' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 349d1987-34c4-4671-ac68-197d35dd5895 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g -l --subnet-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/88ce9056-4f48-452b-99c4-c3e524141cb0?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28: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-arm-service-request-id: + - 6e232944-2bdb-4f5d-9a75-08a8d1a98b47 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g -l --subnet-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000001\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001\",\r\n + \ \"etag\": \"W/\\\"727e74c6-1c89-45c4-8733-9340cec04df1\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus2euap\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"63239842-bf65-4ea4-8a59-08ebf199380d\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000001\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001\",\r\n + \ \"etag\": \"W/\\\"727e74c6-1c89-45c4-8733-9340cec04df1\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1326' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:16 GMT + etag: + - W/"727e74c6-1c89-45c4-8733-9340cec04df1" + 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: + - 13036085-de82-407d-9ac1-0d7efe06b8a3 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"subnet-000001\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001\",\r\n + \ \"etag\": \"W/\\\"727e74c6-1c89-45c4-8733-9340cec04df1\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '547' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:16 GMT + etag: + - W/"727e74c6-1c89-45c4-8733-9340cec04df1" + 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: + - ac2644aa-823f-40f2-b4f8-6756d13a8520 + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001", + "name": "subnet-000001", "type": "Microsoft.Network/virtualNetworks/subnets", + "properties": {"addressPrefix": "10.0.0.0/24", "delegations": [], "privateEndpointNetworkPolicies": + "Disabled", "privateLinkServiceNetworkPolicies": "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + Content-Length: + - '412' + Content-Type: + - application/json + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"subnet-000001\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001\",\r\n + \ \"etag\": \"W/\\\"e8a55cca-2e67-4672-87c0-4c7ef35114fb\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/6d92c089-bad9-4ef8-8bec-414b51b19b22?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '547' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:18 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-arm-service-request-id: + - 910049ff-3636-4bf2-8c5e-42b64347d1d7 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/6d92c089-bad9-4ef8-8bec-414b51b19b22?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:21 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-arm-service-request-id: + - 49d63f5b-aa1e-413e-ab66-31deae2e2354 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"subnet-000001\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001\",\r\n + \ \"etag\": \"W/\\\"8ead6915-e831-44aa-a748-7fab21e14c71\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '548' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:22 GMT + etag: + - W/"8ead6915-e831-44aa-a748-7fab21e14c71" + 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: + - 2217f824-1685-4ae9-b063-f59840ad6165 + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "properties": {"publicNetworkAccess": "Disabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope create + Connection: + - keep-alive + Content-Length: + - '78' + Content-Type: + - application/json + ParameterSetName: + - --location --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001?api-version=2022-03-10 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001","name":"scope-000001","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","properties":{"privateLinkScopeId":"97bbf84d-7936-4ec7-afdd-bf9f97b68d86","publicNetworkAccess":"Disabled","provisioningState":"Succeeded","privateEndpointConnections":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '429' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope update + Connection: + - keep-alive + ParameterSetName: + - --location --tags --public-network-access --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001?api-version=2022-03-10 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001","name":"scope-000001","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","properties":{"privateLinkScopeId":"97bbf84d-7936-4ec7-afdd-bf9f97b68d86","publicNetworkAccess":"Disabled","provisioningState":"Succeeded","privateEndpointConnections":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '429' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "tags": {"Tag1": "Value1"}, "properties": {"publicNetworkAccess": + "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope update + Connection: + - keep-alive + Content-Length: + - '105' + Content-Type: + - application/json + ParameterSetName: + - --location --tags --public-network-access --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001?api-version=2022-03-10 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001","name":"scope-000001","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","properties":{"privateLinkScopeId":"97bbf84d-7936-4ec7-afdd-bf9f97b68d86","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":[]},"tags":{"Tag1":"Value1"}}' + headers: + cache-control: + - no-cache + content-length: + - '453' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes?api-version=2022-03-10 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001","name":"scope-000001","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","tags":{"Tag1":"Value1"},"properties":{"privateLinkScopeId":"97bbf84d-7936-4ec7-afdd-bf9f97b68d86","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":[]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '465' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"tags": {"Tag1": "Value1", "Tag2": "Value2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope update-tag + Connection: + - keep-alive + Content-Length: + - '46' + Content-Type: + - application/json + ParameterSetName: + - --tags --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001?api-version=2022-03-10 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001","name":"scope-000001","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","properties":{"privateLinkScopeId":"97bbf84d-7936-4ec7-afdd-bf9f97b68d86","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":[]},"tags":{"Tag1":"Value1","Tag2":"Value2"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope show + Connection: + - keep-alive + ParameterSetName: + - --scope-name -g + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001?api-version=2022-03-10 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001","name":"scope-000001","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","properties":{"privateLinkScopeId":"97bbf84d-7936-4ec7-afdd-bf9f97b68d86","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":[]},"tags":{"Tag1":"Value1","Tag2":"Value2"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-resource list + Connection: + - keep-alive + ParameterSetName: + - --scope-name -g + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001/privateLinkResources?api-version=2022-03-10 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001/privateLinkResources/hybridcompute","name":"hybridcompute","type":"Microsoft.HybridCompute/privateLinkScopes/privateLinkResources","properties":{"groupId":"hybridcompute","requiredMembers":["HybridCompute.Global","HybridCompute.Server","GuestConfig.GlobalService","GuestConfig.AgentService.eapeus2","GuestConfig.AgentService.eastus2euap","HybridCompute.K8sConfiguration"],"requiredZoneNames":["privatelink.his.arc.azure.com","privatelink.Guestconfiguration.azure.com","privatelink.dp.kubernetesconfiguration.azure.com"]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '691' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/az-sdk-test-000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001","name":"az-sdk-test-000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '238' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:37 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": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001", + "properties": {"privateEndpointNetworkPolicies": "Enabled", "privateLinkServiceNetworkPolicies": + "Enabled"}}, "privateLinkServiceConnections": [{"name": "pec-000001", "properties": + {"privateLinkServiceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001", + "groupIds": ["hybridcompute"]}}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + Content-Length: + - '621' + Content-Type: + - application/json + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/privateEndpoints/pe-000001?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"pe-000001\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/privateEndpoints/pe-000001\",\r\n + \ \"etag\": \"W/\\\"6bcf918d-0273-4c9e-9ba8-5bb456f66714\\\"\",\r\n \"type\": + \"Microsoft.Network/privateEndpoints\",\r\n \"location\": \"eastus2euap\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": + \"846741f3-438c-4413-8cd7-7f5112f41bab\",\r\n \"privateLinkServiceConnections\": + [\r\n {\r\n \"name\": \"pec-000001\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/privateEndpoints/pe-000001/privateLinkServiceConnections/pec-000001\",\r\n + \ \"etag\": \"W/\\\"6bcf918d-0273-4c9e-9ba8-5bb456f66714\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateLinkServiceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001\",\r\n + \ \"groupIds\": [\r\n \"hybridcompute\"\r\n ],\r\n + \ \"privateLinkServiceConnectionState\": {\r\n \"status\": + \"Approved\",\r\n \"description\": \"Auto Approved\",\r\n \"actionsRequired\": + \"None\"\r\n }\r\n },\r\n \"type\": \"Microsoft.Network/privateEndpoints/privateLinkServiceConnections\"\r\n + \ }\r\n ],\r\n \"manualPrivateLinkServiceConnections\": [],\r\n + \ \"customNetworkInterfaceName\": \"\",\r\n \"subnet\": {\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001\"\r\n + \ },\r\n \"ipConfigurations\": [],\r\n \"networkInterfaces\": [\r\n + \ {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/networkInterfaces/pe-000001.nic.87efd997-aa7b-4949-8b5f-6f6cd5c4a4bb\"\r\n + \ }\r\n ],\r\n \"customDnsConfigs\": []\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/c7b4dc66-6b1b-48e2-9eaf-8d502e8761d8?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '2007' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 7f968d80-57a5-4fa8-835e-6496622651a4 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/c7b4dc66-6b1b-48e2-9eaf-8d502e8761d8?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:28:52 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-arm-service-request-id: + - 57765bef-78ac-40de-932e-e5cc9fa411bb + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/c7b4dc66-6b1b-48e2-9eaf-8d502e8761d8?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:29:04 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-arm-service-request-id: + - 7a32a0c6-95a8-4067-a1f6-a0570a83b313 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/c7b4dc66-6b1b-48e2-9eaf-8d502e8761d8?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:29:24 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-arm-service-request-id: + - fc088e7b-45ee-4139-b684-59a08d5ec5eb + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.32.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/privateEndpoints/pe-000001?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"pe-000001\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/privateEndpoints/pe-000001\",\r\n + \ \"etag\": \"W/\\\"db71e587-4909-409f-b421-c11620646561\\\"\",\r\n \"type\": + \"Microsoft.Network/privateEndpoints\",\r\n \"location\": \"eastus2euap\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": + \"846741f3-438c-4413-8cd7-7f5112f41bab\",\r\n \"privateLinkServiceConnections\": + [\r\n {\r\n \"name\": \"pec-000001\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/privateEndpoints/pe-000001/privateLinkServiceConnections/pec-000001\",\r\n + \ \"etag\": \"W/\\\"db71e587-4909-409f-b421-c11620646561\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateLinkServiceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001\",\r\n + \ \"groupIds\": [\r\n \"hybridcompute\"\r\n ],\r\n + \ \"privateLinkServiceConnectionState\": {\r\n \"status\": + \"Approved\",\r\n \"description\": \"Auto-approved\",\r\n \"actionsRequired\": + \"None\"\r\n }\r\n },\r\n \"type\": \"Microsoft.Network/privateEndpoints/privateLinkServiceConnections\"\r\n + \ }\r\n ],\r\n \"manualPrivateLinkServiceConnections\": [],\r\n + \ \"customNetworkInterfaceName\": \"\",\r\n \"subnet\": {\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/virtualNetworks/vnet-000001/subnets/subnet-000001\"\r\n + \ },\r\n \"ipConfigurations\": [],\r\n \"networkInterfaces\": [\r\n + \ {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/networkInterfaces/pe-000001.nic.87efd997-aa7b-4949-8b5f-6f6cd5c4a4bb\"\r\n + \ }\r\n ],\r\n \"customDnsConfigs\": [\r\n {\r\n \"fqdn\": + \"gbl.his.arc.azure.com\",\r\n \"ipAddresses\": [\r\n \"10.0.0.4\"\r\n + \ ]\r\n },\r\n {\r\n \"fqdn\": \"cbn.his.arc.azure.com\",\r\n + \ \"ipAddresses\": [\r\n \"10.0.0.5\"\r\n ]\r\n },\r\n + \ {\r\n \"fqdn\": \"agentserviceapi.guestconfiguration.azure.com\",\r\n + \ \"ipAddresses\": [\r\n \"10.0.0.6\"\r\n ]\r\n },\r\n + \ {\r\n \"fqdn\": \"eapeus2-gas.guestconfiguration.azure.com\",\r\n + \ \"ipAddresses\": [\r\n \"10.0.0.7\"\r\n ]\r\n },\r\n + \ {\r\n \"fqdn\": \"eastus2euap-gas.guestconfiguration.azure.com\",\r\n + \ \"ipAddresses\": [\r\n \"10.0.0.8\"\r\n ]\r\n },\r\n + \ {\r\n \"fqdn\": \"eastus2euap.dp.kubernetesconfiguration.azure.com\",\r\n + \ \"ipAddresses\": [\r\n \"10.0.0.9\"\r\n ]\r\n }\r\n + \ ]\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2825' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:29:24 GMT + etag: + - W/"db71e587-4909-409f-b421-c11620646561" + 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: + - c9f8bee0-0bfb-46ec-9c06-565769661565 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection list + Connection: + - keep-alive + ParameterSetName: + - --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001/privateEndpointConnections?api-version=2022-03-10 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001/privateEndpointConnections/pe-000001.846741f3-438c-4413-8cd7-7f5112f41bab","name":"pe-000001.846741f3-438c-4413-8cd7-7f5112f41bab","type":"Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/privateEndpoints/pe-000001"},"privateLinkServiceConnectionState":{"status":"Approved","description":"Auto-approved","actionsRequired":"None"}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '707' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:29:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"privateLinkServiceConnectionState": {"status": "Rejected", + "description": "Rejected by AZ CLI test"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection update + Connection: + - keep-alive + Content-Length: + - '119' + Content-Type: + - application/json + ParameterSetName: + - --connection-state --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001/privateEndpointConnections/pe-000001.846741f3-438c-4413-8cd7-7f5112f41bab?api-version=2022-03-10 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/f00e7a0e-9b68-4af9-9ca6-0a9563f94712?api-version=2022-03-10 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Fri, 06 May 2022 04:29:28 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/f00e7a0e-9b68-4af9-9ca6-0a9563f94712?api-version=2022-03-10 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection update + Connection: + - keep-alive + ParameterSetName: + - --connection-state --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/f00e7a0e-9b68-4af9-9ca6-0a9563f94712?api-version=2022-03-10 + response: + body: + string: '{"name":"f00e7a0e-9b68-4af9-9ca6-0a9563f94712","status":"Succeeded","startTime":"2022-05-06T04:29:29.1500567Z"}' + headers: + cache-control: + - no-cache + content-length: + - '111' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:29:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection update + Connection: + - keep-alive + ParameterSetName: + - --connection-state --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001/privateEndpointConnections/pe-000001.846741f3-438c-4413-8cd7-7f5112f41bab?api-version=2022-03-10 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001/privateEndpointConnections/pe-000001.846741f3-438c-4413-8cd7-7f5112f41bab","name":"pe-000001.846741f3-438c-4413-8cd7-7f5112f41bab","type":"Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/privateEndpoints/pe-000001"},"privateLinkServiceConnectionState":{"status":"Rejected","description":"Rejected + by AZ CLI test","actionsRequired":"None"}}}' + headers: + cache-control: + - no-cache + content-length: + - '705' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:29:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001/privateEndpointConnections/pe-000001.846741f3-438c-4413-8cd7-7f5112f41bab?api-version=2022-03-10 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001/privateEndpointConnections/pe-000001.846741f3-438c-4413-8cd7-7f5112f41bab","name":"pe-000001.846741f3-438c-4413-8cd7-7f5112f41bab","type":"Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.Network/privateEndpoints/pe-000001"},"privateLinkServiceConnectionState":{"status":"Rejected","description":"Rejected + by AZ CLI test","actionsRequired":"None"}}}' + headers: + cache-control: + - no-cache + content-length: + - '705' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:30:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001/privateEndpointConnections/pe-000001.846741f3-438c-4413-8cd7-7f5112f41bab?api-version=2022-03-10 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/a91df94f-7b54-4d89-ba58-89dd492424cf?api-version=2022-03-10 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Fri, 06 May 2022 04:30:03 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/a91df94f-7b54-4d89-ba58-89dd492424cf?api-version=2022-03-10 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection delete + Connection: + - keep-alive + ParameterSetName: + - -y --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/a91df94f-7b54-4d89-ba58-89dd492424cf?api-version=2022-03-10 + response: + body: + string: '{"name":"a91df94f-7b54-4d89-ba58-89dd492424cf","status":"Succeeded","startTime":"2022-05-06T04:30:03.2592041Z"}' + headers: + cache-control: + - no-cache + content-length: + - '111' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:30:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection list + Connection: + - keep-alive + ParameterSetName: + - --resource-group --scope-name + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test-000001/providers/Microsoft.HybridCompute/privateLinkScopes/scope-000001/privateEndpointConnections?api-version=2022-03-10 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 06 May 2022 04:30:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_connectedmachine_Scenario.yaml b/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_connectedmachine_Scenario.yaml deleted file mode 100644 index ba573d5b070..00000000000 --- a/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_connectedmachine_Scenario.yaml +++ /dev/null @@ -1,990 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine show - Connection: - - keep-alive - ParameterSetName: - - --name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM?api-version=2021-05-20&$expand=instanceView - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM","name":"sdkTestVM","location":"eastus2euap","tags":{},"identity":{"type":"SystemAssigned","principalId":"89888542-ded2-49d6-a64e-f15317b0792c","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"type":"Microsoft.HybridCompute/machines","properties":{"provisioningState":"Succeeded","agentVersion":"1.12.21285.002","status":"Connected","lastStatusChange":"2021-10-27T02:58:47.615613Z","errorDetails":[],"displayName":"dorothy-surface","machineFqdn":"dorothy-surface","osName":"windows","osVersion":"10.0.19043.1288","osProfile":{"computerName":"dorothy-surface"},"vmId":"c921de10-fd9d-47f0-86cd-b7e84d623e1d","vmUuid":"2883CCA3-7EE6-60E9-A204-97718B655D1D","clientPublicKey":"MIIBCgKCAQEAr96QKDsKlM7fn3gNYxNdelHLYEesEebJs8kUiJ5dPioP0Te5G33ib9ELuBN2FAAcHH90AYxqALHvzI/KBikhWQ916Xm9+JwMQs55ZA1tEquFfpHMfhntnWOxNVuogGu7IXuQ/w5S8lUpJGmSfsfUcDeEogI4mpnME00v32wMT6sG5S8khZ2L3kaXCoFiDFoZEAoRn/NCkmze7koUN+ffkTNkgMiGEQFMOO1RTXYfD1TFwcCJvv4BBV0bMX/oRIhamgNzmxgrTTDuQek82P+EVWSXm/7WMEFA3SykmCmfqMVqwWmdm61IVyC74P5lp2HhFMi6g0oxoPF4FUwUqM1nqQIDAQAB","osSku":"Windows - 10 Enterprise","domainName":"redmond.corp.microsoft.com","adFqdn":"dorothy-surface.redmond.corp.microsoft.com","dnsFqdn":"redmond.corp.microsoft.com.dorothy-surface","detectedProperties":{"cloudprovider":"N/A","manufacturer":"Microsoft - Corporation","model":"Surface Book 2","mssqldiscovered":"true"}},"resources":[]}' - headers: - cache-control: - - no-cache - content-length: - - '1510' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 27 Oct 2021 02:59:33 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine list - Connection: - - keep-alive - ParameterSetName: - - --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines?api-version=2021-05-20 - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/dorothylinux2-Virtual-Machine","name":"dorothylinux2-Virtual-Machine","location":"eastus2euap","tags":{},"identity":{"type":"SystemAssigned","principalId":"5ce02094-bd55-44ba-b1e4-2d56b6a6ba69","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"type":"Microsoft.HybridCompute/machines","properties":{"provisioningState":"Succeeded","agentVersion":"1.7.21162.005","status":"Expired","lastStatusChange":"2021-09-30T06:14:01.8555779Z","errorDetails":[],"displayName":"dorothylinux2-Virtual-Machine","machineFqdn":"dorothylinux2-Virtual-Machine","osName":"linux","osVersion":"5.8.0-59-generic","osProfile":{"computerName":"dorothylinux2-Virtual-Machine"},"vmId":"8948ef10-f369-471d-b363-8e2ff44614ca","vmUuid":"80f26cf0-d9a7-4637-a2ff-587bd51626fc","clientPublicKey":"MIIBCgKCAQEAukhdoNaMfaHRGP6MvgdWdyefHdET/mV0J3NdpMU+LFRE5IWwZxG+mGOb2lK3dsgX6HenWyRiumC2BMDX6RuLfRuscZw+HT/W4W/9ScDxbD18o4vECD7DmiFmIs4iPaF8GLTjO2fJzjAl59k7nblfr38SexA8EKo5WqG2LFhbT6CAXtBMPtWebWeZCQ3uXCri8838nDtqhQtqY6Efg4A2sEV9s4Mk7LjINpzcVuPYdvxcFngM22hixUawE9GH8UKIV5XF+/c8xk1b1fvUGizf+sNbgSMZFyJ3Vgg5ne5ibepxyR3WBtmvd3L/mF1negSh/5h9QQKTt7djeUYCb+ztjwIDAQAB","osSku":"Ubuntu - 20.04 LTS","domainName":"unknown","adFqdn":"unknown","dnsFqdn":"dorothylinux2-Virtual-Machine","detectedProperties":{"cloudprovider":"N/A","manufacturer":"Microsoft - Corporation","model":"Virtual Machine","mssqldiscovered":"false"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM","name":"sdkTestVM","location":"eastus2euap","tags":{},"identity":{"type":"SystemAssigned","principalId":"89888542-ded2-49d6-a64e-f15317b0792c","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"type":"Microsoft.HybridCompute/machines","properties":{"provisioningState":"Succeeded","agentVersion":"1.12.21285.002","status":"Connected","lastStatusChange":"2021-10-27T02:58:47.615613Z","errorDetails":[],"displayName":"dorothy-surface","machineFqdn":"dorothy-surface","osName":"windows","osVersion":"10.0.19043.1288","osProfile":{"computerName":"dorothy-surface"},"vmId":"c921de10-fd9d-47f0-86cd-b7e84d623e1d","vmUuid":"2883CCA3-7EE6-60E9-A204-97718B655D1D","clientPublicKey":"MIIBCgKCAQEAr96QKDsKlM7fn3gNYxNdelHLYEesEebJs8kUiJ5dPioP0Te5G33ib9ELuBN2FAAcHH90AYxqALHvzI/KBikhWQ916Xm9+JwMQs55ZA1tEquFfpHMfhntnWOxNVuogGu7IXuQ/w5S8lUpJGmSfsfUcDeEogI4mpnME00v32wMT6sG5S8khZ2L3kaXCoFiDFoZEAoRn/NCkmze7koUN+ffkTNkgMiGEQFMOO1RTXYfD1TFwcCJvv4BBV0bMX/oRIhamgNzmxgrTTDuQek82P+EVWSXm/7WMEFA3SykmCmfqMVqwWmdm61IVyC74P5lp2HhFMi6g0oxoPF4FUwUqM1nqQIDAQAB","osSku":"Windows - 10 Enterprise","domainName":"redmond.corp.microsoft.com","adFqdn":"dorothy-surface.redmond.corp.microsoft.com","dnsFqdn":"redmond.corp.microsoft.com.dorothy-surface","detectedProperties":{"cloudprovider":"N/A","manufacturer":"Microsoft - Corporation","model":"Surface Book 2","mssqldiscovered":"true"}}}]}' - headers: - cache-control: - - no-cache - content-length: - - '3012' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 27 Oct 2021 02:59:34 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"location": "eastus2euap", "properties": {"publisher": "Microsoft.Compute", - "type": "CustomScriptExtension", "typeHandlerVersion": "1.10.10", "enableAutomaticUpgrade": - true, "settings": {"commandToExecute": "powershell.exe -c \"Get-Process | Where-Object - {{ $_.CPU -gt 10000 }}\""}, "instanceView": {"name": "CustomScriptExtension"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension create - Connection: - - keep-alive - Content-Length: - - '335' - Content-Type: - - application/json - ParameterSetName: - - --name --location --enable-auto-upgrade --type --publisher --settings --type-handler-version - --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension?api-version=2021-05-20 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/ef35a372-f75d-45e9-879f-2b9d078ac731?api-version=2021-05-20 - cache-control: - - no-cache - content-length: - - '0' - content-type: - - application/json - date: - - Wed, 27 Oct 2021 02:59:37 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/ef35a372-f75d-45e9-879f-2b9d078ac731?api-version=2021-05-20 - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-resource-requests: - - '31' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension create - Connection: - - keep-alive - ParameterSetName: - - --name --location --enable-auto-upgrade --type --publisher --settings --type-handler-version - --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/ef35a372-f75d-45e9-879f-2b9d078ac731?api-version=2021-05-20 - response: - body: - string: '{"name":"ef35a372-f75d-45e9-879f-2b9d078ac731","status":"Succeeded","startTime":"2021-10-27T02:59:38.3382463Z","properties":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension","name":"CustomScriptExtension","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"powershell.exe - -c \"Get-Process | Where-Object {{ $_.CPU -gt 10000 }}\""},"provisioningState":"Succeeded","instanceView":{"name":"CustomScriptExtension","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: 84 42368 4,653.03 4 0 - System \r\n 767 35 28232 52812 1.80 9792 1 - SystemSettings \r\n 412 22 12024 24476 952.66 14276 1 - TabTip \r\n 331 34 8944 18736 15.13 6648 1 - taskhostw \r\n 345 25 28212 54892 2.00 13700 1 - Teams \r\n 433 23 20512 46528 153.75 14372 1 - Teams \r\n 1774 82 194960 142400 1,522.69 15012 1 - Teams \r\n 1617 32 148328 93836 523.83 15256 1 - Teams \r\n 427 115 279468 261176 1,048.23 15288 1 - Teams \r\n 584 187 413364 354728 1,406.53 15876 1 - Teams \r\n 312 20 13436 58744 15.67 16364 1 - Teams \r\n 1491 72 171928 121760 1,903.17 16944 1 - Teams \r\n 859 50 41408 49008 277.03 8236 0 - TelemetryHost \r\n 567 23 13436 47496 11.00 13720 1 - TextInputHost \r\n 385 15 5108 20184 5.00 16748 0 - uhssvc \r\n 771 40 21440 1868 0.84 1216 1 - Video.UI \r\n 148 8 2132 9432 0.91 5380 0 - vmcompute \r\n 622 25 45464 32144 15.61 3928 0 - vmms \r\n 165 11 1404 5844 0.11 8 0 - wininit \r\n 269 12 2884 12888 4.36 1460 1 - winlogon \r\n 883 49 24612 64368 1.38 13572 1 - WinStore.App \r\n 372 20 52432 56504 782.44 2428 0 - WmiPrvSE \r\n 1070 49 38080 54128 4,884.28 6248 0 - WmiPrvSE \r\n 251 14 6164 13644 51.53 11664 0 - WmiPrvSE \r\n 619 33 59652 56708 148.95 13588 0 - WmiPrvSE \r\n 197 13 11696 14224 39.34 15800 0 - WmiPrvSE \r\n 177 10 3240 9272 7.94 16484 0 - WmiPrvSE \r\n 273 18 5296 17652 18.80 17232 0 - WmiPrvSE \r\n 303 19 5116 17332 0.36 21416 0 - WmiPrvSE \r\n 883 24 10500 13448 5.36 1416 0 - WUDFHost \r\n 332 15 6260 16020 51.55 1632 0 - WUDFHost \r\n 427 10 1956 6536 0.88 2248 0 - WUDFHost \r\n 324 21 1015876 32724 3,064.78 4464 0 - WUDFHost \r\n 921 50 31812 13148 2.34 19136 1 - YourPhone \r\n\r\n\r\n"}}}}}' - headers: - cache-control: - - no-cache - content-length: - - '5112' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 27 Oct 2021 03:04:38 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension create - Connection: - - keep-alive - ParameterSetName: - - --name --location --enable-auto-upgrade --type --publisher --settings --type-handler-version - --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension?api-version=2021-05-20 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension","name":"CustomScriptExtension","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"powershell.exe - -c \"Get-Process | Where-Object {{ $_.CPU -gt 10000 }}\""},"provisioningState":"Succeeded","instanceView":{"name":"CustomScriptExtension","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: 84 42368 4,653.03 4 0 - System \r\n 767 35 28232 52812 1.80 9792 1 - SystemSettings \r\n 412 22 12024 24476 952.66 14276 1 - TabTip \r\n 331 34 8944 18736 15.13 6648 1 - taskhostw \r\n 345 25 28212 54892 2.00 13700 1 - Teams \r\n 433 23 20512 46528 153.75 14372 1 - Teams \r\n 1774 82 194960 142400 1,522.69 15012 1 - Teams \r\n 1617 32 148328 93836 523.83 15256 1 - Teams \r\n 427 115 279468 261176 1,048.23 15288 1 - Teams \r\n 584 187 413364 354728 1,406.53 15876 1 - Teams \r\n 312 20 13436 58744 15.67 16364 1 - Teams \r\n 1491 72 171928 121760 1,903.17 16944 1 - Teams \r\n 859 50 41408 49008 277.03 8236 0 - TelemetryHost \r\n 567 23 13436 47496 11.00 13720 1 - TextInputHost \r\n 385 15 5108 20184 5.00 16748 0 - uhssvc \r\n 771 40 21440 1868 0.84 1216 1 - Video.UI \r\n 148 8 2132 9432 0.91 5380 0 - vmcompute \r\n 622 25 45464 32144 15.61 3928 0 - vmms \r\n 165 11 1404 5844 0.11 8 0 - wininit \r\n 269 12 2884 12888 4.36 1460 1 - winlogon \r\n 883 49 24612 64368 1.38 13572 1 - WinStore.App \r\n 372 20 52432 56504 782.44 2428 0 - WmiPrvSE \r\n 1070 49 38080 54128 4,884.28 6248 0 - WmiPrvSE \r\n 251 14 6164 13644 51.53 11664 0 - WmiPrvSE \r\n 619 33 59652 56708 148.95 13588 0 - WmiPrvSE \r\n 197 13 11696 14224 39.34 15800 0 - WmiPrvSE \r\n 177 10 3240 9272 7.94 16484 0 - WmiPrvSE \r\n 273 18 5296 17652 18.80 17232 0 - WmiPrvSE \r\n 303 19 5116 17332 0.36 21416 0 - WmiPrvSE \r\n 883 24 10500 13448 5.36 1416 0 - WUDFHost \r\n 332 15 6260 16020 51.55 1632 0 - WUDFHost \r\n 427 10 1956 6536 0.88 2248 0 - WUDFHost \r\n 324 21 1015876 32724 3,064.78 4464 0 - WUDFHost \r\n 921 50 31812 13148 2.34 19136 1 - YourPhone \r\n\r\n\r\n"}}}}' - headers: - cache-control: - - no-cache - content-length: - - '4987' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 27 Oct 2021 03:04:39 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension list - Connection: - - keep-alive - ParameterSetName: - - --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions?api-version=2021-05-20 - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension","name":"CustomScriptExtension","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"powershell.exe - -c \"Get-Process | Where-Object {{ $_.CPU -gt 10000 }}\""},"provisioningState":"Succeeded","instanceView":{"name":"CustomScriptExtension","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: 84 42368 4,653.03 4 0 - System \r\n 767 35 28232 52812 1.80 9792 1 - SystemSettings \r\n 412 22 12024 24476 952.66 14276 1 - TabTip \r\n 331 34 8944 18736 15.13 6648 1 - taskhostw \r\n 345 25 28212 54892 2.00 13700 1 - Teams \r\n 433 23 20512 46528 153.75 14372 1 - Teams \r\n 1774 82 194960 142400 1,522.69 15012 1 - Teams \r\n 1617 32 148328 93836 523.83 15256 1 - Teams \r\n 427 115 279468 261176 1,048.23 15288 1 - Teams \r\n 584 187 413364 354728 1,406.53 15876 1 - Teams \r\n 312 20 13436 58744 15.67 16364 1 - Teams \r\n 1491 72 171928 121760 1,903.17 16944 1 - Teams \r\n 859 50 41408 49008 277.03 8236 0 - TelemetryHost \r\n 567 23 13436 47496 11.00 13720 1 - TextInputHost \r\n 385 15 5108 20184 5.00 16748 0 - uhssvc \r\n 771 40 21440 1868 0.84 1216 1 - Video.UI \r\n 148 8 2132 9432 0.91 5380 0 - vmcompute \r\n 622 25 45464 32144 15.61 3928 0 - vmms \r\n 165 11 1404 5844 0.11 8 0 - wininit \r\n 269 12 2884 12888 4.36 1460 1 - winlogon \r\n 883 49 24612 64368 1.38 13572 1 - WinStore.App \r\n 372 20 52432 56504 782.44 2428 0 - WmiPrvSE \r\n 1070 49 38080 54128 4,884.28 6248 0 - WmiPrvSE \r\n 251 14 6164 13644 51.53 11664 0 - WmiPrvSE \r\n 619 33 59652 56708 148.95 13588 0 - WmiPrvSE \r\n 197 13 11696 14224 39.34 15800 0 - WmiPrvSE \r\n 177 10 3240 9272 7.94 16484 0 - WmiPrvSE \r\n 273 18 5296 17652 18.80 17232 0 - WmiPrvSE \r\n 303 19 5116 17332 0.36 21416 0 - WmiPrvSE \r\n 883 24 10500 13448 5.36 1416 0 - WUDFHost \r\n 332 15 6260 16020 51.55 1632 0 - WUDFHost \r\n 427 10 1956 6536 0.88 2248 0 - WUDFHost \r\n 324 21 1015876 32724 3,064.78 4464 0 - WUDFHost \r\n 921 50 31812 13148 2.34 19136 1 - YourPhone \r\n\r\n\r\n"}}}}]}' - headers: - cache-control: - - no-cache - content-length: - - '4999' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 27 Oct 2021 03:04:40 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension show - Connection: - - keep-alive - ParameterSetName: - - --name --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension?api-version=2021-05-20 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension","name":"CustomScriptExtension","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"powershell.exe - -c \"Get-Process | Where-Object {{ $_.CPU -gt 10000 }}\""},"provisioningState":"Succeeded","instanceView":{"name":"CustomScriptExtension","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: 84 42368 4,653.03 4 0 - System \r\n 767 35 28232 52812 1.80 9792 1 - SystemSettings \r\n 412 22 12024 24476 952.66 14276 1 - TabTip \r\n 331 34 8944 18736 15.13 6648 1 - taskhostw \r\n 345 25 28212 54892 2.00 13700 1 - Teams \r\n 433 23 20512 46528 153.75 14372 1 - Teams \r\n 1774 82 194960 142400 1,522.69 15012 1 - Teams \r\n 1617 32 148328 93836 523.83 15256 1 - Teams \r\n 427 115 279468 261176 1,048.23 15288 1 - Teams \r\n 584 187 413364 354728 1,406.53 15876 1 - Teams \r\n 312 20 13436 58744 15.67 16364 1 - Teams \r\n 1491 72 171928 121760 1,903.17 16944 1 - Teams \r\n 859 50 41408 49008 277.03 8236 0 - TelemetryHost \r\n 567 23 13436 47496 11.00 13720 1 - TextInputHost \r\n 385 15 5108 20184 5.00 16748 0 - uhssvc \r\n 771 40 21440 1868 0.84 1216 1 - Video.UI \r\n 148 8 2132 9432 0.91 5380 0 - vmcompute \r\n 622 25 45464 32144 15.61 3928 0 - vmms \r\n 165 11 1404 5844 0.11 8 0 - wininit \r\n 269 12 2884 12888 4.36 1460 1 - winlogon \r\n 883 49 24612 64368 1.38 13572 1 - WinStore.App \r\n 372 20 52432 56504 782.44 2428 0 - WmiPrvSE \r\n 1070 49 38080 54128 4,884.28 6248 0 - WmiPrvSE \r\n 251 14 6164 13644 51.53 11664 0 - WmiPrvSE \r\n 619 33 59652 56708 148.95 13588 0 - WmiPrvSE \r\n 197 13 11696 14224 39.34 15800 0 - WmiPrvSE \r\n 177 10 3240 9272 7.94 16484 0 - WmiPrvSE \r\n 273 18 5296 17652 18.80 17232 0 - WmiPrvSE \r\n 303 19 5116 17332 0.36 21416 0 - WmiPrvSE \r\n 883 24 10500 13448 5.36 1416 0 - WUDFHost \r\n 332 15 6260 16020 51.55 1632 0 - WUDFHost \r\n 427 10 1956 6536 0.88 2248 0 - WUDFHost \r\n 324 21 1015876 32724 3,064.78 4464 0 - WUDFHost \r\n 921 50 31812 13148 2.34 19136 1 - YourPhone \r\n\r\n\r\n"}}}}' - headers: - cache-control: - - no-cache - content-length: - - '4987' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 27 Oct 2021 03:04:41 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"extensionTargets": {"Microsoft.Compute.CustomScriptExtension": {"targetVersion": - "1.10.12"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine upgrade-extension - Connection: - - keep-alive - Content-Length: - - '95' - Content-Type: - - application/json - ParameterSetName: - - --extension-targets --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/upgradeExtensions?api-version=2021-05-20 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/3b0fe23e-bdfe-4dc7-8913-2c7a2575754b?api-version=2021-05-20 - cache-control: - - no-cache - content-length: - - '0' - content-type: - - application/json - date: - - Wed, 27 Oct 2021 03:04:42 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/3b0fe23e-bdfe-4dc7-8913-2c7a2575754b?api-version=2021-05-20 - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine upgrade-extension - Connection: - - keep-alive - ParameterSetName: - - --extension-targets --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/3b0fe23e-bdfe-4dc7-8913-2c7a2575754b?api-version=2021-05-20 - response: - body: - string: '{"name":"3b0fe23e-bdfe-4dc7-8913-2c7a2575754b","status":"Succeeded","startTime":"2021-10-27T03:04:42.5873351Z","properties":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension","name":"CustomScriptExtension","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"provisioningState":"Succeeded","instanceView":{"name":"CustomScriptExtension","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: 84 42368 4,653.03 4 0 - System \r\n 767 35 28232 52812 1.80 9792 1 - SystemSettings \r\n 412 22 12024 24476 952.66 14276 1 - TabTip \r\n 331 34 8944 18736 15.13 6648 1 - taskhostw \r\n 345 25 28212 54892 2.00 13700 1 - Teams \r\n 433 23 20512 46528 153.75 14372 1 - Teams \r\n 1774 82 194960 142400 1,522.69 15012 1 - Teams \r\n 1617 32 148328 93836 523.83 15256 1 - Teams \r\n 427 115 279468 261176 1,048.23 15288 1 - Teams \r\n 584 187 413364 354728 1,406.53 15876 1 - Teams \r\n 312 20 13436 58744 15.67 16364 1 - Teams \r\n 1491 72 171928 121760 1,903.17 16944 1 - Teams \r\n 859 50 41408 49008 277.03 8236 0 - TelemetryHost \r\n 567 23 13436 47496 11.00 13720 1 - TextInputHost \r\n 385 15 5108 20184 5.00 16748 0 - uhssvc \r\n 771 40 21440 1868 0.84 1216 1 - Video.UI \r\n 148 8 2132 9432 0.91 5380 0 - vmcompute \r\n 622 25 45464 32144 15.61 3928 0 - vmms \r\n 165 11 1404 5844 0.11 8 0 - wininit \r\n 269 12 2884 12888 4.36 1460 1 - winlogon \r\n 883 49 24612 64368 1.38 13572 1 - WinStore.App \r\n 372 20 52432 56504 782.44 2428 0 - WmiPrvSE \r\n 1070 49 38080 54128 4,884.28 6248 0 - WmiPrvSE \r\n 251 14 6164 13644 51.53 11664 0 - WmiPrvSE \r\n 619 33 59652 56708 148.95 13588 0 - WmiPrvSE \r\n 197 13 11696 14224 39.34 15800 0 - WmiPrvSE \r\n 177 10 3240 9272 7.94 16484 0 - WmiPrvSE \r\n 273 18 5296 17652 18.80 17232 0 - WmiPrvSE \r\n 303 19 5116 17332 0.36 21416 0 - WmiPrvSE \r\n 883 24 10500 13448 5.36 1416 0 - WUDFHost \r\n 332 15 6260 16020 51.55 1632 0 - WUDFHost \r\n 427 10 1956 6536 0.88 2248 0 - WUDFHost \r\n 324 21 1015876 32724 3,064.78 4464 0 - WUDFHost \r\n 921 50 31812 13148 2.34 19136 1 - YourPhone \r\n\r\n\r\n"}}}}]}' - headers: - cache-control: - - no-cache - content-length: - - '5009' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 27 Oct 2021 03:09:43 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine upgrade-extension - Connection: - - keep-alive - ParameterSetName: - - --extension-targets --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/3b0fe23e-bdfe-4dc7-8913-2c7a2575754b?api-version=2021-05-20 - response: - body: - string: '[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension","name":"CustomScriptExtension","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"provisioningState":"Succeeded","instanceView":{"name":"CustomScriptExtension","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: 84 42368 4,653.03 4 0 - System \r\n 767 35 28232 52812 1.80 9792 1 - SystemSettings \r\n 412 22 12024 24476 952.66 14276 1 - TabTip \r\n 331 34 8944 18736 15.13 6648 1 - taskhostw \r\n 345 25 28212 54892 2.00 13700 1 - Teams \r\n 433 23 20512 46528 153.75 14372 1 - Teams \r\n 1774 82 194960 142400 1,522.69 15012 1 - Teams \r\n 1617 32 148328 93836 523.83 15256 1 - Teams \r\n 427 115 279468 261176 1,048.23 15288 1 - Teams \r\n 584 187 413364 354728 1,406.53 15876 1 - Teams \r\n 312 20 13436 58744 15.67 16364 1 - Teams \r\n 1491 72 171928 121760 1,903.17 16944 1 - Teams \r\n 859 50 41408 49008 277.03 8236 0 - TelemetryHost \r\n 567 23 13436 47496 11.00 13720 1 - TextInputHost \r\n 385 15 5108 20184 5.00 16748 0 - uhssvc \r\n 771 40 21440 1868 0.84 1216 1 - Video.UI \r\n 148 8 2132 9432 0.91 5380 0 - vmcompute \r\n 622 25 45464 32144 15.61 3928 0 - vmms \r\n 165 11 1404 5844 0.11 8 0 - wininit \r\n 269 12 2884 12888 4.36 1460 1 - winlogon \r\n 883 49 24612 64368 1.38 13572 1 - WinStore.App \r\n 372 20 52432 56504 782.44 2428 0 - WmiPrvSE \r\n 1070 49 38080 54128 4,884.28 6248 0 - WmiPrvSE \r\n 251 14 6164 13644 51.53 11664 0 - WmiPrvSE \r\n 619 33 59652 56708 148.95 13588 0 - WmiPrvSE \r\n 197 13 11696 14224 39.34 15800 0 - WmiPrvSE \r\n 177 10 3240 9272 7.94 16484 0 - WmiPrvSE \r\n 273 18 5296 17652 18.80 17232 0 - WmiPrvSE \r\n 303 19 5116 17332 0.36 21416 0 - WmiPrvSE \r\n 883 24 10500 13448 5.36 1416 0 - WUDFHost \r\n 332 15 6260 16020 51.55 1632 0 - WUDFHost \r\n 427 10 1956 6536 0.88 2248 0 - WUDFHost \r\n 324 21 1015876 32724 3,064.78 4464 0 - WUDFHost \r\n 921 50 31812 13148 2.34 19136 1 - YourPhone \r\n\r\n\r\n"}}}}]' - headers: - cache-control: - - no-cache - content-length: - - '4884' - content-type: - - application/json - date: - - Wed, 27 Oct 2021 03:09:44 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"properties": {"enableAutomaticUpgrade": false, "settings": {"commandToExecute": - "hostname"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension update - Connection: - - keep-alive - Content-Length: - - '95' - Content-Type: - - application/json - ParameterSetName: - - --name --enable-auto-upgrade --settings --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension?api-version=2021-05-20 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/5f8a2d25-c330-4e42-b03c-350221d80930?api-version=2021-05-20 - cache-control: - - no-cache - content-length: - - '0' - content-type: - - application/json - date: - - Wed, 27 Oct 2021 03:09:44 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/5f8a2d25-c330-4e42-b03c-350221d80930?api-version=2021-05-20 - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-resource-requests: - - '31' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension update - Connection: - - keep-alive - ParameterSetName: - - --name --enable-auto-upgrade --settings --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/5f8a2d25-c330-4e42-b03c-350221d80930?api-version=2021-05-20 - response: - body: - string: '{"name":"5f8a2d25-c330-4e42-b03c-350221d80930","status":"Succeeded","startTime":"2021-10-27T03:09:45.3470506Z","properties":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension","name":"CustomScriptExtension","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"CustomScriptExtension","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: dorothy-surface\r\n"}}}}}' - headers: - cache-control: - - no-cache - content-length: - - '901' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 27 Oct 2021 03:14:45 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension update - Connection: - - keep-alive - ParameterSetName: - - --name --enable-auto-upgrade --settings --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension?api-version=2021-05-20 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension","name":"CustomScriptExtension","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"CustomScriptExtension","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: dorothy-surface\r\n"}}}}' - headers: - cache-control: - - no-cache - content-length: - - '776' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 27 Oct 2021 03:14:46 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -y --name --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM/extensions/CustomScriptExtension?api-version=2021-05-20 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/e2245146-96ea-48ca-8092-f3ed2e6dde0b?api-version=2021-05-20 - cache-control: - - no-cache - content-length: - - '0' - content-type: - - application/json - date: - - Wed, 27 Oct 2021 03:14:49 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/e2245146-96ea-48ca-8092-f3ed2e6dde0b?api-version=2021-05-20 - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension delete - Connection: - - keep-alive - ParameterSetName: - - -y --name --machine-name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/e2245146-96ea-48ca-8092-f3ed2e6dde0b?api-version=2021-05-20 - response: - body: - string: '{"name":"e2245146-96ea-48ca-8092-f3ed2e6dde0b","status":"Succeeded","startTime":"2021-10-27T03:14:49.1147266Z"}' - headers: - cache-control: - - no-cache - content-length: - - '111' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 27 Oct 2021 03:19:49 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -y --name --resource-group - User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/sdkTestVM?api-version=2021-05-20 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - content-type: - - application/json - date: - - Wed, 27 Oct 2021 03:19:55 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 200 - message: OK -version: 1 diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/test_ConnectedMachineAndExtension_scenario.py b/src/connectedmachine/azext_connectedmachine/tests/latest/test_ConnectedMachineAndExtension_scenario.py new file mode 100644 index 00000000000..99c491b0fd7 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/test_ConnectedMachineAndExtension_scenario.py @@ -0,0 +1,141 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import os +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_show +from .example_steps import step_list +from .example_steps import step_extension_create +from .example_steps import step_extension_list +from .example_steps import step_extension_show +from .example_steps import step_extension_update +from .example_steps import step_upgrade_extension +from .example_steps import step_extension_delete +from .example_steps import step_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test): + pass + + +@try_manual +def test_machine_and_extension(test): + test.kwargs.update({ + 'machine': 'testMachine', + 'rg': 'az-sdk-test', + 'location': 'eastus2euap', + 'customScriptName': test.create_random_name('custom-', 20), + }) + + test.cmd('az connectedmachine show -n {machine} -g {rg}', checks=[ + test.check('name', '{machine}'), + test.check('resourceGroup', '{rg}') + ]) + + test.cmd('az connectedmachine list -g {rg}', checks=[ + test.check('length(@)', 2) + ]) + + test.cmd('az connectedmachine extension create ' + '--name "{customScriptName}" ' + '--location "{location}" ' + '--enable-auto-upgrade true ' + '--type "CustomScriptExtension" ' + '--publisher "Microsoft.Compute" ' + '--type-handler-version "1.10.10" ' + '--machine-name "{machine}" ' + '--resource-group "{rg}" ' + '--settings "{{\\"commandToExecute\\":\\"hostname\\"}}"', + checks=[ + test.check('name', '{customScriptName}'), + test.check('properties.typeHandlerVersion', '1.10.10'), + test.check('properties.settings.commandToExecute', 'hostname') + ]) + + test.cmd('az connectedmachine extension list ' + '--machine-name {machine} -g {rg}', + checks=[ + test.check('length(@)', 1) + ]) + + test.cmd('az connectedmachine extension show ' + '--name {customScriptName} ' + '--machine-name "{machine}" ' + '--resource-group "{rg}"', + checks=[ + test.check('name', '{customScriptName}'), + test.check('properties.typeHandlerVersion', '1.10.10') + ]) + + test.cmd('az connectedmachine upgrade-extension ' + '--extension-targets "{{\\"Microsoft.Compute.CustomScriptExtension\\":{{\\"targetVersion\\":\\"1.10.12\\"}}}}" ' + '--machine-name "{machine}" ' + '--resource-group "{rg}"', + checks=[]) + + test.cmd('az connectedmachine extension update ' + '--name "{customScriptName}" ' + '--settings "{{\\"commandToExecute\\":\\"dir\\"}}" ' + '--machine-name "{machine}" ' + '--resource-group "{rg}"', + checks=[ + test.check('name', '{customScriptName}'), + test.check('properties.provisioningState', 'Succeeded'), + test.check('properties.settings.commandToExecute', 'dir'), + test.check('properties.typeHandlerVersion', '1.10.12') + ]) + + test.cmd('az connectedmachine extension delete -y ' + '--name "{customScriptName}" ' + '--machine-name "{machine}" ' + '--resource-group "{rg}"', + checks=[]) + + test.cmd('az connectedmachine delete -y ' + '--name "{machine}" ' + '--resource-group "{rg}"', + checks=[]) + +# Testcase: Scenario +@try_manual +def call_scenario(test): + setup_scenario(test) + test_machine_and_extension(test) + cleanup_scenario(test) + + +# Test class for Scenario +@try_manual +class ConnectedMachineAndExtensionScenarioTest(ScenarioTest): + def __init__(self, *args, **kwargs): + super(ConnectedMachineAndExtensionScenarioTest, self).__init__(*args, **kwargs) + + + def test_ConnectedMachineAndExtension_Scenario(self): + call_scenario(self) + calc_coverage(__file__) + raise_if() diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/test_ConnectedMachineAndExtension_scenario_coverage.md b/src/connectedmachine/azext_connectedmachine/tests/latest/test_ConnectedMachineAndExtension_scenario_coverage.md new file mode 100644 index 00000000000..cb712843009 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/test_ConnectedMachineAndExtension_scenario_coverage.md @@ -0,0 +1,2 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +Coverage: 0/0 diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/test_PrivateLinkAndPrivateEndpointConnection_scenario.py b/src/connectedmachine/azext_connectedmachine/tests/latest/test_PrivateLinkAndPrivateEndpointConnection_scenario.py new file mode 100644 index 00000000000..d46a0a1bdc8 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/test_PrivateLinkAndPrivateEndpointConnection_scenario.py @@ -0,0 +1,180 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import os +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_private_link_resource_list +from .example_steps import step_private_link_scope_create +from .example_steps import step_private_link_scope_update +from .example_steps import step_private_link_scope_show +from .example_steps import step_private_link_scope_list +from .example_steps import step_private_link_scope_list2 +from .example_steps import step_private_link_scope_update_tag +from .example_steps import step_private_endpoint_connection_update +from .example_steps import step_private_endpoint_connection_list +from .example_steps import step_private_endpoint_connection_show +from .example_steps import step_private_endpoint_connection_delete +from .example_steps import step_private_link_scope_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test): + pass + + +def test_private_link(test): + rand_string = test.create_random_name('', 5) + test.kwargs.update({ + 'machine': 'testMachine', + 'rg': 'az-sdk-test-' + rand_string, + 'scope': 'scope-' + rand_string, + 'vnet': 'vnet-' + rand_string, + 'subnet': 'subnet-' + rand_string, + 'private_endpoint': 'pe-' + rand_string, + 'private_endpoint_connection': 'pec-' + rand_string, + 'location': 'eastus2euap', + 'customScriptName': 'custom-' + rand_string, + }) + + # Prepare network + test.cmd('az group create -n {rg} -l {location}', + checks=test.check('name', '{rg}')) + + # Prepare network + test.cmd('az network vnet create -n {vnet} -g {rg} -l {location} --subnet-name {subnet}', + checks=test.check('length(newVNet.subnets)', 1)) + test.cmd('az network vnet subnet update -n {subnet} --vnet-name {vnet} -g {rg} ' + '--disable-private-endpoint-network-policies true', + checks=test.check('privateEndpointNetworkPolicies', 'Disabled')) + + # Create a private link scope + test.cmd('az connectedmachine private-link-scope create ' + '--location "{location}" ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + test.check('name','{scope}'), + test.check('properties.publicNetworkAccess','Disabled') + ]) + + # Update the private link scope + test.cmd('az connectedmachine private-link-scope update ' + '--location "{location}" ' + '--tags Tag1="Value1" ' + '--public-network-access Enabled ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + test.check('name','{scope}'), + test.check('properties.publicNetworkAccess','Enabled') + ]) + + # Test private link scope list + test.cmd('az connectedmachine private-link-scope list ' + '--resource-group "{rg}"', + checks=[ + test.check('length(@)', 1) + ]) + + # Private link scope update tag + test.cmd('az connectedmachine private-link-scope update-tag ' + '--tags Tag1="Value1" Tag2="Value2" ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + test.check('length(tags)', 2) + ]) + + # Private link scope show + private_link_scope = test.cmd('az connectedmachine private-link-scope show --scope-name {scope} -g {rg}').get_output_in_json() + test.kwargs['scope_id'] = private_link_scope['id'] + + # Test private link resource list + test.cmd('az connectedmachine private-link-resource list --scope-name {scope} -g {rg}', checks=[ + test.check('length(@)', 1) + ]) + + result = test.cmd('az network private-endpoint create -g {rg} -n {private_endpoint} --vnet-name {vnet} --subnet {subnet} --private-connection-resource-id {scope_id} ' + '--connection-name {private_endpoint_connection} --group-id hybridcompute').get_output_in_json() + test.assertTrue(test.kwargs['private_endpoint'].lower() in result['name'].lower()) + + connection_list = test.cmd('az connectedmachine private-endpoint-connection list ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"').get_output_in_json() + test.kwargs['private_endpoint_connection_name'] = connection_list[0]['name'] + + test.cmd('az connectedmachine private-endpoint-connection update ' + '--connection-state description="Rejected by AZ CLI test" status="Rejected" ' + '--name "{private_endpoint_connection_name}" ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + test.check('name', '{private_endpoint_connection_name}'), + test.check('properties.privateLinkServiceConnectionState.description', 'Rejected by AZ CLI test'), + test.check('properties.privateLinkServiceConnectionState.status', 'Rejected') + ]) + + test.cmd('az connectedmachine private-endpoint-connection show ' + '--name "{private_endpoint_connection_name}" ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + test.check('name', '{private_endpoint_connection_name}'), + test.check('properties.privateLinkServiceConnectionState.description', 'Rejected by AZ CLI test'), + test.check('properties.privateLinkServiceConnectionState.status', 'Rejected') + ]) + + test.cmd('az connectedmachine private-endpoint-connection delete -y ' + '--name "{private_endpoint_connection_name}" ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[]) + + test.cmd('az connectedmachine private-endpoint-connection list ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + test.check('length(@)', 0) + ]) + + +# Testcase: Scenario +@try_manual +def call_scenario(test): + setup_scenario(test) + test_private_link(test) + cleanup_scenario(test) + + +# Test class for Scenario +@try_manual +class PrivateLinkAndPrivateEndpointConnectionScenarioTest(ScenarioTest): + def __init__(self, *args, **kwargs): + super(PrivateLinkAndPrivateEndpointConnectionScenarioTest, self).__init__(*args, **kwargs) + def test_PrivateLinkAndPrivateEndpointConnection_Scenario(self): + call_scenario(self) + calc_coverage(__file__) + raise_if() diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/test_PrivateLinkAndPrivateEndpointConnection_scenario_coverage.md b/src/connectedmachine/azext_connectedmachine/tests/latest/test_PrivateLinkAndPrivateEndpointConnection_scenario_coverage.md new file mode 100644 index 00000000000..cb712843009 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/test_PrivateLinkAndPrivateEndpointConnection_scenario_coverage.md @@ -0,0 +1,2 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +Coverage: 0/0 diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/test_connectedmachine_scenario.py b/src/connectedmachine/azext_connectedmachine/tests/latest/test_connectedmachine_scenario.py deleted file mode 100644 index 1455de589fc..00000000000 --- a/src/connectedmachine/azext_connectedmachine/tests/latest/test_connectedmachine_scenario.py +++ /dev/null @@ -1,136 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import os -from azure.cli.testsdk import ScenarioTest -from azure.cli.testsdk import ResourceGroupPreparer -from .example_steps import step_show -from .example_steps import step_list -from .example_steps import step_upgrade_extension -from .example_steps import step_extension_create -from .example_steps import step_extension_list -from .example_steps import step_extension_show -from .example_steps import step_extension_update -from .example_steps import step_extension_delete -from .example_steps import step_delete -from .example_steps import step_private_endpoint_connection_update -from .example_steps import step_private_endpoint_connection_list -from .example_steps import step_private_endpoint_connection_show -from .example_steps import step_private_endpoint_connection_delete -from .example_steps import step_private_link_resource_list -from .example_steps import step_private_link_scope_create -from .example_steps import step_private_link_scope_update -from .example_steps import step_private_link_scope_show -from .example_steps import step_private_link_scope_list -from .example_steps import step_private_link_scope_update_tag -from .example_steps import step_private_link_scope_delete -from .. import ( - try_manual, - raise_if, - calc_coverage -) - - -TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) - -MACHINE_NAME = 'sdkTestVM' -RESOURCE_GROUP = 'az-sdk-test' -LOCATION = 'eastus2euap' -EXTENSION_NAME = 'CustomScriptExtension' -SCOPE_NAME = '' -PRIVATE_ENDPOINT_NAME = '' - -# Env setup_scenario -@try_manual -def setup_scenario(test): - pass - - -# Env cleanup_scenario -@try_manual -def cleanup_scenario(test): - pass - - -# Testcase: Scenario -@try_manual -def call_scenario(test): - setup_scenario(test) - step_show(test, checks=[ - test.check('name', MACHINE_NAME), - test.check('resourceGroup', RESOURCE_GROUP) - ]) - step_list(test, checks=[ - test.check('length(@)', 2) - ]) - step_extension_create(test, checks=[ - test.check('name', EXTENSION_NAME), - test.check('properties.typeHandlerVersion', '1.10.10') - ]) - step_extension_list(test, checks=[ - test.check('length(@)', 1) - ]) - step_extension_show(test, checks=[ - test.check('name', EXTENSION_NAME), - test.check('properties.typeHandlerVersion', '1.10.10') - ]) - step_upgrade_extension(test, checks=[]) - step_extension_update(test, checks=[ - test.check('name', EXTENSION_NAME), - test.check('properties.provisioningState', 'Succeeded'), - test.check('properties.settings.commandToExecute', 'hostname'), - test.check('properties.typeHandlerVersion', '1.10.12') - ]) - step_extension_delete(test, checks=[]) - step_delete(test, checks=[]) - # Below functions are manually tested - # -------------------------------------------------------------- - # step_private_link_scope_create(test, checks=[ - # test.check('name', SCOPE_NAME), - # test.check('location', LOCATION), - # test.check('length(tags)', 0) - # ]) - # step_private_link_scope_update(test, checks=[ - - # ]) - # step_private_link_scope_show(test, checks=[]) - # step_private_link_scope_list(test, checks=[]) - # step_private_link_scope_update_tag(test, checks=[]) - # step_private_link_scope_delete(test, checks=[]) - - # step_private_endpoint_connection_list(test, checks=[ - # test.check('length(@)', 1), - # ]) - # step_private_endpoint_connection_show(test, checks=[ - # test.check("name", "{myPrivateEndpointConnection}", case_sensitive=False), - # ]) - # step_private_endpoint_connection_delete(test, checks=[]) - # step_private_link_resource_list(test, checks=[]) - cleanup_scenario(test) - - -# Test class for Scenario -@try_manual -class ConnectedmachineScenarioTest(ScenarioTest): - def __init__(self, *args, **kwargs): - super(ConnectedmachineScenarioTest, self).__init__(*args, **kwargs) - self.kwargs.update({ - 'myMachine': 'myMachine', - 'myMachine2': 'machineName', - 'myPrivateEndpointConnection': 'private-endpoint-connection-name', - }) - - @ResourceGroupPreparer(name_prefix='clitestconnectedmachine_myResourceGroup'[:7], key='rg', parameter_name='rg') - @ResourceGroupPreparer(name_prefix='clitestconnectedmachine_my-resource-group'[:7], key='rg_2', - parameter_name='rg_2') - def test_connectedmachine_Scenario(self, rg, rg_2): - call_scenario(self) - calc_coverage(__file__) - raise_if() diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py index 102684e1826..c7c9373c9d8 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-05-20" + self.api_version = "2022-03-10" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-hybridcompute/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration.py index 04e5e5f423c..2ea09f521a0 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-05-20" + self.api_version = "2022-03-10" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-hybridcompute/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py index b05efa22595..228a61224a8 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py @@ -34,7 +34,7 @@ async def _upgrade_extensions_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -63,7 +63,7 @@ async def _upgrade_extensions_initial( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py index b9868deb183..fb842b7813b 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py @@ -56,7 +56,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -190,7 +190,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -323,7 +323,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -452,7 +452,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -515,7 +515,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py index c066f92566e..7a88248b470 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py @@ -63,7 +63,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -122,7 +122,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -181,7 +181,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): @@ -250,7 +250,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_operations.py index 581f88b893a..8c9cc6fd77e 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py index 29a4616941d..9f69296c1c3 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py @@ -68,7 +68,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -119,7 +119,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -252,7 +252,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -378,7 +378,7 @@ def list_by_private_link_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py index 59d91002542..9548d75237c 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py @@ -63,7 +63,7 @@ def list_by_private_link_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): @@ -141,7 +141,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py index dcc71ced523..7016f1261ab 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py @@ -59,7 +59,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): @@ -129,7 +129,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): @@ -192,7 +192,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -312,7 +312,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -376,7 +376,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -449,7 +449,7 @@ async def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -513,7 +513,7 @@ async def get_validation_details( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -573,7 +573,7 @@ async def get_validation_details_for_machine( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py index 1046533c5d8..9db77773a31 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AgentConfiguration + from ._models_py3 import CloudMetadata + from ._models_py3 import ConfigurationExtension from ._models_py3 import ConnectionDetail from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail @@ -34,7 +37,10 @@ from ._models_py3 import OperationValue from ._models_py3 import OperationValueDisplay from ._models_py3 import OsProfile + from ._models_py3 import OsProfileLinuxConfiguration + from ._models_py3 import OsProfileWindowsConfiguration from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionDataModel from ._models_py3 import PrivateEndpointConnectionListResult from ._models_py3 import PrivateEndpointConnectionProperties from ._models_py3 import PrivateEndpointProperty @@ -47,10 +53,15 @@ from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import ResourceUpdate + from ._models_py3 import ServiceStatus + from ._models_py3 import ServiceStatuses from ._models_py3 import SystemData from ._models_py3 import TagsResource from ._models_py3 import TrackedResource except (SyntaxError, ImportError): + from ._models import AgentConfiguration # type: ignore + from ._models import CloudMetadata # type: ignore + from ._models import ConfigurationExtension # type: ignore from ._models import ConnectionDetail # type: ignore from ._models import ErrorAdditionalInfo # type: ignore from ._models import ErrorDetail # type: ignore @@ -78,7 +89,10 @@ from ._models import OperationValue # type: ignore from ._models import OperationValueDisplay # type: ignore from ._models import OsProfile # type: ignore + from ._models import OsProfileLinuxConfiguration # type: ignore + from ._models import OsProfileWindowsConfiguration # type: ignore from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionDataModel # type: ignore from ._models import PrivateEndpointConnectionListResult # type: ignore from ._models import PrivateEndpointConnectionProperties # type: ignore from ._models import PrivateEndpointProperty # type: ignore @@ -91,19 +105,26 @@ from ._models import ProxyResource # type: ignore from ._models import Resource # type: ignore from ._models import ResourceUpdate # type: ignore + from ._models import ServiceStatus # type: ignore + from ._models import ServiceStatuses # type: ignore from ._models import SystemData # type: ignore from ._models import TagsResource # type: ignore from ._models import TrackedResource # type: ignore from ._connected_machine_enums import ( + AssessmentModeTypes, CreatedByType, InstanceViewTypes, + PatchModeTypes, PublicNetworkAccessType, StatusLevelTypes, StatusTypes, ) __all__ = [ + 'AgentConfiguration', + 'CloudMetadata', + 'ConfigurationExtension', 'ConnectionDetail', 'ErrorAdditionalInfo', 'ErrorDetail', @@ -131,7 +152,10 @@ 'OperationValue', 'OperationValueDisplay', 'OsProfile', + 'OsProfileLinuxConfiguration', + 'OsProfileWindowsConfiguration', 'PrivateEndpointConnection', + 'PrivateEndpointConnectionDataModel', 'PrivateEndpointConnectionListResult', 'PrivateEndpointConnectionProperties', 'PrivateEndpointProperty', @@ -144,11 +168,15 @@ 'ProxyResource', 'Resource', 'ResourceUpdate', + 'ServiceStatus', + 'ServiceStatuses', 'SystemData', 'TagsResource', 'TrackedResource', + 'AssessmentModeTypes', 'CreatedByType', 'InstanceViewTypes', + 'PatchModeTypes', 'PublicNetworkAccessType', 'StatusLevelTypes', 'StatusTypes', diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_connected_machine_enums.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_connected_machine_enums.py index dec09de8f57..c88ee3bbe4d 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_connected_machine_enums.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_connected_machine_enums.py @@ -26,6 +26,13 @@ def __getattr__(cls, name): raise AttributeError(name) +class AssessmentModeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the assessment mode. + """ + + IMAGE_DEFAULT = "ImageDefault" + AUTOMATIC_BY_PLATFORM = "AutomaticByPlatform" + class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -39,6 +46,15 @@ class InstanceViewTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): INSTANCE_VIEW = "instanceView" +class PatchModeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the patch mode. + """ + + IMAGE_DEFAULT = "ImageDefault" + AUTOMATIC_BY_PLATFORM = "AutomaticByPlatform" + AUTOMATIC_BY_OS = "AutomaticByOS" + MANUAL = "Manual" + class PublicNetworkAccessType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The network access policy to determine if Azure Arc agents can use public Azure Arc service endpoints. Defaults to disabled (access to Azure Arc services only via private link). diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py index c430690dd8d..e9192629f9a 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py @@ -10,6 +10,119 @@ import msrest.serialization +class AgentConfiguration(msrest.serialization.Model): + """Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar proxy_url: Specifies the URL of the proxy to be used. + :vartype proxy_url: str + :ivar incoming_connections_ports: Specifies the list of ports that the agent will be able to + listen on. + :vartype incoming_connections_ports: list[str] + :ivar extensions_allow_list: Array of extensions that are allowed to be installed or updated. + :vartype extensions_allow_list: list[~azure.mgmt.hybridcompute.models.ConfigurationExtension] + :ivar extensions_block_list: Array of extensions that are blocked (cannot be installed or + updated). + :vartype extensions_block_list: list[~azure.mgmt.hybridcompute.models.ConfigurationExtension] + :ivar proxy_bypass: List of service names which should not use the specified proxy server. + :vartype proxy_bypass: list[str] + :ivar extensions_enabled: Specifies whether the extension service is enabled or disabled. + :vartype extensions_enabled: str + :ivar guest_configuration_enabled: Specified whether the guest configuration service is enabled + or disabled. + :vartype guest_configuration_enabled: str + """ + + _validation = { + 'proxy_url': {'readonly': True}, + 'incoming_connections_ports': {'readonly': True}, + 'extensions_allow_list': {'readonly': True}, + 'extensions_block_list': {'readonly': True}, + 'proxy_bypass': {'readonly': True}, + 'extensions_enabled': {'readonly': True}, + 'guest_configuration_enabled': {'readonly': True}, + } + + _attribute_map = { + 'proxy_url': {'key': 'proxyUrl', 'type': 'str'}, + 'incoming_connections_ports': {'key': 'incomingConnectionsPorts', 'type': '[str]'}, + 'extensions_allow_list': {'key': 'extensionsAllowList', 'type': '[ConfigurationExtension]'}, + 'extensions_block_list': {'key': 'extensionsBlockList', 'type': '[ConfigurationExtension]'}, + 'proxy_bypass': {'key': 'proxyBypass', 'type': '[str]'}, + 'extensions_enabled': {'key': 'extensionsEnabled', 'type': 'str'}, + 'guest_configuration_enabled': {'key': 'guestConfigurationEnabled', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentConfiguration, self).__init__(**kwargs) + self.proxy_url = None + self.incoming_connections_ports = None + self.extensions_allow_list = None + self.extensions_block_list = None + self.proxy_bypass = None + self.extensions_enabled = None + self.guest_configuration_enabled = None + + +class CloudMetadata(msrest.serialization.Model): + """The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Specifies the cloud provider (Azure/AWS/GCP...). + :vartype provider: str + """ + + _validation = { + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudMetadata, self).__init__(**kwargs) + self.provider = None + + +class ConfigurationExtension(msrest.serialization.Model): + """Describes properties that can identify extensions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar publisher: Publisher of the extension. + :vartype publisher: str + :ivar type: Type of the extension. + :vartype type: str + """ + + _validation = { + 'publisher': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConfigurationExtension, self).__init__(**kwargs) + self.publisher = None + self.type = None + + class ConnectionDetail(msrest.serialization.Model): """ConnectionDetail. @@ -309,17 +422,22 @@ class HybridComputePrivateLinkScopeProperties(msrest.serialization.Model): :vartype provisioning_state: str :ivar private_link_scope_id: The Guid id of the private link scope. :vartype private_link_scope_id: str + :ivar private_endpoint_connections: The collection of associated Private Endpoint Connections. + :vartype private_endpoint_connections: + list[~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionDataModel] """ _validation = { 'provisioning_state': {'readonly': True}, 'private_link_scope_id': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'private_link_scope_id': {'key': 'privateLinkScopeId', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnectionDataModel]'}, } def __init__( @@ -330,6 +448,7 @@ def __init__( self.public_network_access = kwargs.get('public_network_access', "Disabled") self.provisioning_state = None self.private_link_scope_id = None + self.private_endpoint_connections = None class Identity(msrest.serialization.Model): @@ -675,9 +794,9 @@ class MachineExtensionProperties(msrest.serialization.Model): :type type: str :param type_handler_version: Specifies the version of the script handler. :type type_handler_version: str - :param enable_auto_upgrade: Indicates whether the extension should be automatically + :param enable_automatic_upgrade: Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. - :type enable_auto_upgrade: bool + :type enable_automatic_upgrade: bool :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. @@ -702,7 +821,7 @@ class MachineExtensionProperties(msrest.serialization.Model): 'publisher': {'key': 'publisher', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_auto_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, + 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, 'settings': {'key': 'settings', 'type': 'object'}, 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, @@ -719,7 +838,7 @@ def __init__( self.publisher = kwargs.get('publisher', None) self.type = kwargs.get('type', None) self.type_handler_version = kwargs.get('type_handler_version', None) - self.enable_auto_upgrade = kwargs.get('enable_auto_upgrade', None) + self.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) self.settings = kwargs.get('settings', None) self.protected_settings = kwargs.get('protected_settings', None) @@ -804,9 +923,6 @@ class MachineExtensionUpdateProperties(msrest.serialization.Model): :type type: str :param type_handler_version: Specifies the version of the script handler. :type type_handler_version: str - :param enable_auto_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :type enable_auto_upgrade: bool :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. @@ -823,7 +939,6 @@ class MachineExtensionUpdateProperties(msrest.serialization.Model): 'publisher': {'key': 'publisher', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_auto_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, 'settings': {'key': 'settings', 'type': 'object'}, 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, @@ -838,7 +953,6 @@ def __init__( self.publisher = kwargs.get('publisher', None) self.type = kwargs.get('type', None) self.type_handler_version = kwargs.get('type_handler_version', None) - self.enable_auto_upgrade = kwargs.get('enable_auto_upgrade', None) self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) self.settings = kwargs.get('settings', None) self.protected_settings = kwargs.get('protected_settings', None) @@ -900,8 +1014,15 @@ class MachineProperties(msrest.serialization.Model): :param location_data: Metadata pertaining to the geographic location of the resource. :type location_data: ~azure.mgmt.hybridcompute.models.LocationData - :ivar os_profile: Specifies the operating system settings for the hybrid machine. - :vartype os_profile: ~azure.mgmt.hybridcompute.models.OsProfile + :ivar agent_configuration: Configurable properties that the user can set locally via the + azcmagent config command, or remotely via ARM. + :vartype agent_configuration: ~azure.mgmt.hybridcompute.models.AgentConfiguration + :param service_statuses: Statuses of dependent services that are reported back to ARM. + :type service_statuses: ~azure.mgmt.hybridcompute.models.ServiceStatuses + :param cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + :type cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata + :param os_profile: Specifies the operating system settings for the hybrid machine. + :type os_profile: ~azure.mgmt.hybridcompute.models.OsProfile :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar status: The status of the hybrid machine agent. Possible values include: "Connected", @@ -926,6 +1047,8 @@ class MachineProperties(msrest.serialization.Model): :vartype os_name: str :ivar os_version: The version of Operating System running on the hybrid machine. :vartype os_version: str + :param os_type: The type of Operating System (windows/linux). + :type os_type: str :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. :vartype vm_uuid: str :param extensions: Machine Extensions information. @@ -944,12 +1067,14 @@ class MachineProperties(msrest.serialization.Model): :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. :type parent_cluster_resource_id: str + :param mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. + :type mssql_discovered: str :ivar detected_properties: Detected properties from the machine. :vartype detected_properties: dict[str, str] """ _validation = { - 'os_profile': {'readonly': True}, + 'agent_configuration': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'status': {'readonly': True}, 'last_status_change': {'readonly': True}, @@ -969,6 +1094,9 @@ class MachineProperties(msrest.serialization.Model): _attribute_map = { 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentConfiguration'}, + 'service_statuses': {'key': 'serviceStatuses', 'type': 'ServiceStatuses'}, + 'cloud_metadata': {'key': 'cloudMetadata', 'type': 'CloudMetadata'}, 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'status': {'key': 'status', 'type': 'str'}, @@ -981,6 +1109,7 @@ class MachineProperties(msrest.serialization.Model): 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, 'os_name': {'key': 'osName', 'type': 'str'}, 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, 'vm_uuid': {'key': 'vmUuid', 'type': 'str'}, 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, 'os_sku': {'key': 'osSku', 'type': 'str'}, @@ -989,6 +1118,7 @@ class MachineProperties(msrest.serialization.Model): 'dns_fqdn': {'key': 'dnsFqdn', 'type': 'str'}, 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, + 'mssql_discovered': {'key': 'mssqlDiscovered', 'type': 'str'}, 'detected_properties': {'key': 'detectedProperties', 'type': '{str}'}, } @@ -998,7 +1128,10 @@ def __init__( ): super(MachineProperties, self).__init__(**kwargs) self.location_data = kwargs.get('location_data', None) - self.os_profile = None + self.agent_configuration = None + self.service_statuses = kwargs.get('service_statuses', None) + self.cloud_metadata = kwargs.get('cloud_metadata', None) + self.os_profile = kwargs.get('os_profile', None) self.provisioning_state = None self.status = None self.last_status_change = None @@ -1010,6 +1143,7 @@ def __init__( self.client_public_key = kwargs.get('client_public_key', None) self.os_name = None self.os_version = None + self.os_type = kwargs.get('os_type', None) self.vm_uuid = None self.extensions = kwargs.get('extensions', None) self.os_sku = None @@ -1018,6 +1152,7 @@ def __init__( self.dns_fqdn = None self.private_link_scope_resource_id = kwargs.get('private_link_scope_resource_id', None) self.parent_cluster_resource_id = kwargs.get('parent_cluster_resource_id', None) + self.mssql_discovered = kwargs.get('mssql_discovered', None) self.detected_properties = None @@ -1052,6 +1187,10 @@ class MachineUpdateProperties(msrest.serialization.Model): :param location_data: Metadata pertaining to the geographic location of the resource. :type location_data: ~azure.mgmt.hybridcompute.models.LocationData + :param os_profile: Specifies the operating system settings for the hybrid machine. + :type os_profile: ~azure.mgmt.hybridcompute.models.OsProfile + :param cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + :type cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. :type parent_cluster_resource_id: str @@ -1062,6 +1201,8 @@ class MachineUpdateProperties(msrest.serialization.Model): _attribute_map = { 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, + 'cloud_metadata': {'key': 'cloudMetadata', 'type': 'CloudMetadata'}, 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, } @@ -1072,6 +1213,8 @@ def __init__( ): super(MachineUpdateProperties, self).__init__(**kwargs) self.location_data = kwargs.get('location_data', None) + self.os_profile = kwargs.get('os_profile', None) + self.cloud_metadata = kwargs.get('cloud_metadata', None) self.parent_cluster_resource_id = kwargs.get('parent_cluster_resource_id', None) self.private_link_scope_resource_id = kwargs.get('private_link_scope_resource_id', None) @@ -1112,17 +1255,21 @@ class OperationValue(msrest.serialization.Model): :vartype name: str :param display: Display properties. :type display: ~azure.mgmt.hybridcompute.models.OperationValueDisplay + :ivar is_data_action: This property indicates if the operation is an action or a data action. + :vartype is_data_action: bool """ _validation = { 'origin': {'readonly': True}, 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, } _attribute_map = { 'origin': {'key': 'origin', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationValueDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } def __init__( @@ -1133,6 +1280,7 @@ def __init__( self.origin = None self.name = None self.display = kwargs.get('display', None) + self.is_data_action = None class OperationValueDisplay(msrest.serialization.Model): @@ -1182,6 +1330,10 @@ class OsProfile(msrest.serialization.Model): :ivar computer_name: Specifies the host OS name of the hybrid machine. :vartype computer_name: str + :param windows_configuration: Specifies the windows configuration for update management. + :type windows_configuration: ~azure.mgmt.hybridcompute.models.OsProfileWindowsConfiguration + :param linux_configuration: Specifies the linux configuration for update management. + :type linux_configuration: ~azure.mgmt.hybridcompute.models.OsProfileLinuxConfiguration """ _validation = { @@ -1190,6 +1342,8 @@ class OsProfile(msrest.serialization.Model): _attribute_map = { 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'OsProfileWindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'OsProfileLinuxConfiguration'}, } def __init__( @@ -1198,6 +1352,58 @@ def __init__( ): super(OsProfile, self).__init__(**kwargs) self.computer_name = None + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + + +class OsProfileLinuxConfiguration(msrest.serialization.Model): + """Specifies the linux configuration for update management. + + :param assessment_mode: Specifies the assessment mode. Possible values include: "ImageDefault", + "AutomaticByPlatform". + :type assessment_mode: str or ~azure.mgmt.hybridcompute.models.AssessmentModeTypes + :param patch_mode: Specifies the patch mode. Possible values include: "ImageDefault", + "AutomaticByPlatform", "AutomaticByOS", "Manual". + :type patch_mode: str or ~azure.mgmt.hybridcompute.models.PatchModeTypes + """ + + _attribute_map = { + 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, + 'patch_mode': {'key': 'patchSettings.patchMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OsProfileLinuxConfiguration, self).__init__(**kwargs) + self.assessment_mode = kwargs.get('assessment_mode', None) + self.patch_mode = kwargs.get('patch_mode', None) + + +class OsProfileWindowsConfiguration(msrest.serialization.Model): + """Specifies the windows configuration for update management. + + :param assessment_mode: Specifies the assessment mode. Possible values include: "ImageDefault", + "AutomaticByPlatform". + :type assessment_mode: str or ~azure.mgmt.hybridcompute.models.AssessmentModeTypes + :param patch_mode: Specifies the patch mode. Possible values include: "ImageDefault", + "AutomaticByPlatform", "AutomaticByOS", "Manual". + :type patch_mode: str or ~azure.mgmt.hybridcompute.models.PatchModeTypes + """ + + _attribute_map = { + 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, + 'patch_mode': {'key': 'patchSettings.patchMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OsProfileWindowsConfiguration, self).__init__(**kwargs) + self.assessment_mode = kwargs.get('assessment_mode', None) + self.patch_mode = kwargs.get('patch_mode', None) class PrivateEndpointConnection(Resource): @@ -1243,6 +1449,45 @@ def __init__( self.system_data = None +class PrivateEndpointConnectionDataModel(msrest.serialization.Model): + """The Data Model for a Private Endpoint Connection associated with a Private Link Scope. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM Resource Id of the Private Endpoint. + :vartype id: str + :ivar name: The Name of the Private Endpoint. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param properties: The Private Endpoint Connection properties. + :type properties: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionDataModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs.get('properties', None) + + class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. @@ -1286,16 +1531,20 @@ class PrivateEndpointConnectionProperties(msrest.serialization.Model): ~azure.mgmt.hybridcompute.models.PrivateLinkServiceConnectionStateProperty :ivar provisioning_state: State of the private endpoint connection. :vartype provisioning_state: str + :ivar group_ids: List of group IDs. + :vartype group_ids: list[str] """ _validation = { 'provisioning_state': {'readonly': True}, + 'group_ids': {'readonly': True}, } _attribute_map = { 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointProperty'}, 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'group_ids': {'key': 'groupIds', 'type': '[str]'}, } def __init__( @@ -1306,6 +1555,7 @@ def __init__( self.private_endpoint = kwargs.get('private_endpoint', None) self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) self.provisioning_state = None + self.group_ids = None class PrivateEndpointProperty(msrest.serialization.Model): @@ -1541,6 +1791,53 @@ def __init__( super(ProxyResource, self).__init__(**kwargs) +class ServiceStatus(msrest.serialization.Model): + """Describes the status and behavior of a service. + + :param status: The current status of the service. + :type status: str + :param startup_type: The behavior of the service when the Arc-enabled machine starts up. + :type startup_type: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'startup_type': {'key': 'startupType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceStatus, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.startup_type = kwargs.get('startup_type', None) + + +class ServiceStatuses(msrest.serialization.Model): + """Reports the state and behavior of dependent services. + + :param extension_service: The state of the extension service on the Arc-enabled machine. + :type extension_service: ~azure.mgmt.hybridcompute.models.ServiceStatus + :param guest_configuration_service: The state of the guest configuration service on the Arc- + enabled machine. + :type guest_configuration_service: ~azure.mgmt.hybridcompute.models.ServiceStatus + """ + + _attribute_map = { + 'extension_service': {'key': 'extensionService', 'type': 'ServiceStatus'}, + 'guest_configuration_service': {'key': 'guestConfigurationService', 'type': 'ServiceStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceStatuses, self).__init__(**kwargs) + self.extension_service = kwargs.get('extension_service', None) + self.guest_configuration_service = kwargs.get('guest_configuration_service', None) + + class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py index 53262b0d285..0d76e93a88f 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py @@ -15,6 +15,119 @@ from ._connected_machine_enums import * +class AgentConfiguration(msrest.serialization.Model): + """Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar proxy_url: Specifies the URL of the proxy to be used. + :vartype proxy_url: str + :ivar incoming_connections_ports: Specifies the list of ports that the agent will be able to + listen on. + :vartype incoming_connections_ports: list[str] + :ivar extensions_allow_list: Array of extensions that are allowed to be installed or updated. + :vartype extensions_allow_list: list[~azure.mgmt.hybridcompute.models.ConfigurationExtension] + :ivar extensions_block_list: Array of extensions that are blocked (cannot be installed or + updated). + :vartype extensions_block_list: list[~azure.mgmt.hybridcompute.models.ConfigurationExtension] + :ivar proxy_bypass: List of service names which should not use the specified proxy server. + :vartype proxy_bypass: list[str] + :ivar extensions_enabled: Specifies whether the extension service is enabled or disabled. + :vartype extensions_enabled: str + :ivar guest_configuration_enabled: Specified whether the guest configuration service is enabled + or disabled. + :vartype guest_configuration_enabled: str + """ + + _validation = { + 'proxy_url': {'readonly': True}, + 'incoming_connections_ports': {'readonly': True}, + 'extensions_allow_list': {'readonly': True}, + 'extensions_block_list': {'readonly': True}, + 'proxy_bypass': {'readonly': True}, + 'extensions_enabled': {'readonly': True}, + 'guest_configuration_enabled': {'readonly': True}, + } + + _attribute_map = { + 'proxy_url': {'key': 'proxyUrl', 'type': 'str'}, + 'incoming_connections_ports': {'key': 'incomingConnectionsPorts', 'type': '[str]'}, + 'extensions_allow_list': {'key': 'extensionsAllowList', 'type': '[ConfigurationExtension]'}, + 'extensions_block_list': {'key': 'extensionsBlockList', 'type': '[ConfigurationExtension]'}, + 'proxy_bypass': {'key': 'proxyBypass', 'type': '[str]'}, + 'extensions_enabled': {'key': 'extensionsEnabled', 'type': 'str'}, + 'guest_configuration_enabled': {'key': 'guestConfigurationEnabled', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentConfiguration, self).__init__(**kwargs) + self.proxy_url = None + self.incoming_connections_ports = None + self.extensions_allow_list = None + self.extensions_block_list = None + self.proxy_bypass = None + self.extensions_enabled = None + self.guest_configuration_enabled = None + + +class CloudMetadata(msrest.serialization.Model): + """The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Specifies the cloud provider (Azure/AWS/GCP...). + :vartype provider: str + """ + + _validation = { + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudMetadata, self).__init__(**kwargs) + self.provider = None + + +class ConfigurationExtension(msrest.serialization.Model): + """Describes properties that can identify extensions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar publisher: Publisher of the extension. + :vartype publisher: str + :ivar type: Type of the extension. + :vartype type: str + """ + + _validation = { + 'publisher': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConfigurationExtension, self).__init__(**kwargs) + self.publisher = None + self.type = None + + class ConnectionDetail(msrest.serialization.Model): """ConnectionDetail. @@ -328,17 +441,22 @@ class HybridComputePrivateLinkScopeProperties(msrest.serialization.Model): :vartype provisioning_state: str :ivar private_link_scope_id: The Guid id of the private link scope. :vartype private_link_scope_id: str + :ivar private_endpoint_connections: The collection of associated Private Endpoint Connections. + :vartype private_endpoint_connections: + list[~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionDataModel] """ _validation = { 'provisioning_state': {'readonly': True}, 'private_link_scope_id': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'private_link_scope_id': {'key': 'privateLinkScopeId', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnectionDataModel]'}, } def __init__( @@ -351,6 +469,7 @@ def __init__( self.public_network_access = public_network_access self.provisioning_state = None self.private_link_scope_id = None + self.private_endpoint_connections = None class Identity(msrest.serialization.Model): @@ -724,9 +843,9 @@ class MachineExtensionProperties(msrest.serialization.Model): :type type: str :param type_handler_version: Specifies the version of the script handler. :type type_handler_version: str - :param enable_auto_upgrade: Indicates whether the extension should be automatically + :param enable_automatic_upgrade: Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. - :type enable_auto_upgrade: bool + :type enable_automatic_upgrade: bool :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. @@ -751,7 +870,7 @@ class MachineExtensionProperties(msrest.serialization.Model): 'publisher': {'key': 'publisher', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_auto_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, + 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, 'settings': {'key': 'settings', 'type': 'object'}, 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, @@ -766,7 +885,7 @@ def __init__( publisher: Optional[str] = None, type: Optional[str] = None, type_handler_version: Optional[str] = None, - enable_auto_upgrade: Optional[bool] = None, + enable_automatic_upgrade: Optional[bool] = None, auto_upgrade_minor_version: Optional[bool] = None, settings: Optional[object] = None, protected_settings: Optional[object] = None, @@ -778,7 +897,7 @@ def __init__( self.publisher = publisher self.type = type self.type_handler_version = type_handler_version - self.enable_auto_upgrade = enable_auto_upgrade + self.enable_automatic_upgrade = enable_automatic_upgrade self.auto_upgrade_minor_version = auto_upgrade_minor_version self.settings = settings self.protected_settings = protected_settings @@ -871,9 +990,6 @@ class MachineExtensionUpdateProperties(msrest.serialization.Model): :type type: str :param type_handler_version: Specifies the version of the script handler. :type type_handler_version: str - :param enable_auto_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :type enable_auto_upgrade: bool :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. @@ -890,7 +1006,6 @@ class MachineExtensionUpdateProperties(msrest.serialization.Model): 'publisher': {'key': 'publisher', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_auto_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, 'settings': {'key': 'settings', 'type': 'object'}, 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, @@ -903,7 +1018,6 @@ def __init__( publisher: Optional[str] = None, type: Optional[str] = None, type_handler_version: Optional[str] = None, - enable_auto_upgrade: Optional[bool] = None, auto_upgrade_minor_version: Optional[bool] = None, settings: Optional[object] = None, protected_settings: Optional[object] = None, @@ -914,7 +1028,6 @@ def __init__( self.publisher = publisher self.type = type self.type_handler_version = type_handler_version - self.enable_auto_upgrade = enable_auto_upgrade self.auto_upgrade_minor_version = auto_upgrade_minor_version self.settings = settings self.protected_settings = protected_settings @@ -981,8 +1094,15 @@ class MachineProperties(msrest.serialization.Model): :param location_data: Metadata pertaining to the geographic location of the resource. :type location_data: ~azure.mgmt.hybridcompute.models.LocationData - :ivar os_profile: Specifies the operating system settings for the hybrid machine. - :vartype os_profile: ~azure.mgmt.hybridcompute.models.OsProfile + :ivar agent_configuration: Configurable properties that the user can set locally via the + azcmagent config command, or remotely via ARM. + :vartype agent_configuration: ~azure.mgmt.hybridcompute.models.AgentConfiguration + :param service_statuses: Statuses of dependent services that are reported back to ARM. + :type service_statuses: ~azure.mgmt.hybridcompute.models.ServiceStatuses + :param cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + :type cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata + :param os_profile: Specifies the operating system settings for the hybrid machine. + :type os_profile: ~azure.mgmt.hybridcompute.models.OsProfile :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar status: The status of the hybrid machine agent. Possible values include: "Connected", @@ -1007,6 +1127,8 @@ class MachineProperties(msrest.serialization.Model): :vartype os_name: str :ivar os_version: The version of Operating System running on the hybrid machine. :vartype os_version: str + :param os_type: The type of Operating System (windows/linux). + :type os_type: str :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. :vartype vm_uuid: str :param extensions: Machine Extensions information. @@ -1025,12 +1147,14 @@ class MachineProperties(msrest.serialization.Model): :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. :type parent_cluster_resource_id: str + :param mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. + :type mssql_discovered: str :ivar detected_properties: Detected properties from the machine. :vartype detected_properties: dict[str, str] """ _validation = { - 'os_profile': {'readonly': True}, + 'agent_configuration': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'status': {'readonly': True}, 'last_status_change': {'readonly': True}, @@ -1050,6 +1174,9 @@ class MachineProperties(msrest.serialization.Model): _attribute_map = { 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentConfiguration'}, + 'service_statuses': {'key': 'serviceStatuses', 'type': 'ServiceStatuses'}, + 'cloud_metadata': {'key': 'cloudMetadata', 'type': 'CloudMetadata'}, 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'status': {'key': 'status', 'type': 'str'}, @@ -1062,6 +1189,7 @@ class MachineProperties(msrest.serialization.Model): 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, 'os_name': {'key': 'osName', 'type': 'str'}, 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, 'vm_uuid': {'key': 'vmUuid', 'type': 'str'}, 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, 'os_sku': {'key': 'osSku', 'type': 'str'}, @@ -1070,6 +1198,7 @@ class MachineProperties(msrest.serialization.Model): 'dns_fqdn': {'key': 'dnsFqdn', 'type': 'str'}, 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, + 'mssql_discovered': {'key': 'mssqlDiscovered', 'type': 'str'}, 'detected_properties': {'key': 'detectedProperties', 'type': '{str}'}, } @@ -1077,16 +1206,24 @@ def __init__( self, *, location_data: Optional["LocationData"] = None, + service_statuses: Optional["ServiceStatuses"] = None, + cloud_metadata: Optional["CloudMetadata"] = None, + os_profile: Optional["OsProfile"] = None, vm_id: Optional[str] = None, client_public_key: Optional[str] = None, + os_type: Optional[str] = None, extensions: Optional[List["MachineExtensionInstanceView"]] = None, private_link_scope_resource_id: Optional[str] = None, parent_cluster_resource_id: Optional[str] = None, + mssql_discovered: Optional[str] = None, **kwargs ): super(MachineProperties, self).__init__(**kwargs) self.location_data = location_data - self.os_profile = None + self.agent_configuration = None + self.service_statuses = service_statuses + self.cloud_metadata = cloud_metadata + self.os_profile = os_profile self.provisioning_state = None self.status = None self.last_status_change = None @@ -1098,6 +1235,7 @@ def __init__( self.client_public_key = client_public_key self.os_name = None self.os_version = None + self.os_type = os_type self.vm_uuid = None self.extensions = extensions self.os_sku = None @@ -1106,6 +1244,7 @@ def __init__( self.dns_fqdn = None self.private_link_scope_resource_id = private_link_scope_resource_id self.parent_cluster_resource_id = parent_cluster_resource_id + self.mssql_discovered = mssql_discovered self.detected_properties = None @@ -1144,6 +1283,10 @@ class MachineUpdateProperties(msrest.serialization.Model): :param location_data: Metadata pertaining to the geographic location of the resource. :type location_data: ~azure.mgmt.hybridcompute.models.LocationData + :param os_profile: Specifies the operating system settings for the hybrid machine. + :type os_profile: ~azure.mgmt.hybridcompute.models.OsProfile + :param cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + :type cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. :type parent_cluster_resource_id: str @@ -1154,6 +1297,8 @@ class MachineUpdateProperties(msrest.serialization.Model): _attribute_map = { 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, + 'cloud_metadata': {'key': 'cloudMetadata', 'type': 'CloudMetadata'}, 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, } @@ -1162,12 +1307,16 @@ def __init__( self, *, location_data: Optional["LocationData"] = None, + os_profile: Optional["OsProfile"] = None, + cloud_metadata: Optional["CloudMetadata"] = None, parent_cluster_resource_id: Optional[str] = None, private_link_scope_resource_id: Optional[str] = None, **kwargs ): super(MachineUpdateProperties, self).__init__(**kwargs) self.location_data = location_data + self.os_profile = os_profile + self.cloud_metadata = cloud_metadata self.parent_cluster_resource_id = parent_cluster_resource_id self.private_link_scope_resource_id = private_link_scope_resource_id @@ -1208,17 +1357,21 @@ class OperationValue(msrest.serialization.Model): :vartype name: str :param display: Display properties. :type display: ~azure.mgmt.hybridcompute.models.OperationValueDisplay + :ivar is_data_action: This property indicates if the operation is an action or a data action. + :vartype is_data_action: bool """ _validation = { 'origin': {'readonly': True}, 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, } _attribute_map = { 'origin': {'key': 'origin', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationValueDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } def __init__( @@ -1231,6 +1384,7 @@ def __init__( self.origin = None self.name = None self.display = display + self.is_data_action = None class OperationValueDisplay(msrest.serialization.Model): @@ -1280,6 +1434,10 @@ class OsProfile(msrest.serialization.Model): :ivar computer_name: Specifies the host OS name of the hybrid machine. :vartype computer_name: str + :param windows_configuration: Specifies the windows configuration for update management. + :type windows_configuration: ~azure.mgmt.hybridcompute.models.OsProfileWindowsConfiguration + :param linux_configuration: Specifies the linux configuration for update management. + :type linux_configuration: ~azure.mgmt.hybridcompute.models.OsProfileLinuxConfiguration """ _validation = { @@ -1288,14 +1446,77 @@ class OsProfile(msrest.serialization.Model): _attribute_map = { 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'OsProfileWindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'OsProfileLinuxConfiguration'}, } def __init__( self, + *, + windows_configuration: Optional["OsProfileWindowsConfiguration"] = None, + linux_configuration: Optional["OsProfileLinuxConfiguration"] = None, **kwargs ): super(OsProfile, self).__init__(**kwargs) self.computer_name = None + self.windows_configuration = windows_configuration + self.linux_configuration = linux_configuration + + +class OsProfileLinuxConfiguration(msrest.serialization.Model): + """Specifies the linux configuration for update management. + + :param assessment_mode: Specifies the assessment mode. Possible values include: "ImageDefault", + "AutomaticByPlatform". + :type assessment_mode: str or ~azure.mgmt.hybridcompute.models.AssessmentModeTypes + :param patch_mode: Specifies the patch mode. Possible values include: "ImageDefault", + "AutomaticByPlatform", "AutomaticByOS", "Manual". + :type patch_mode: str or ~azure.mgmt.hybridcompute.models.PatchModeTypes + """ + + _attribute_map = { + 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, + 'patch_mode': {'key': 'patchSettings.patchMode', 'type': 'str'}, + } + + def __init__( + self, + *, + assessment_mode: Optional[Union[str, "AssessmentModeTypes"]] = None, + patch_mode: Optional[Union[str, "PatchModeTypes"]] = None, + **kwargs + ): + super(OsProfileLinuxConfiguration, self).__init__(**kwargs) + self.assessment_mode = assessment_mode + self.patch_mode = patch_mode + + +class OsProfileWindowsConfiguration(msrest.serialization.Model): + """Specifies the windows configuration for update management. + + :param assessment_mode: Specifies the assessment mode. Possible values include: "ImageDefault", + "AutomaticByPlatform". + :type assessment_mode: str or ~azure.mgmt.hybridcompute.models.AssessmentModeTypes + :param patch_mode: Specifies the patch mode. Possible values include: "ImageDefault", + "AutomaticByPlatform", "AutomaticByOS", "Manual". + :type patch_mode: str or ~azure.mgmt.hybridcompute.models.PatchModeTypes + """ + + _attribute_map = { + 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, + 'patch_mode': {'key': 'patchSettings.patchMode', 'type': 'str'}, + } + + def __init__( + self, + *, + assessment_mode: Optional[Union[str, "AssessmentModeTypes"]] = None, + patch_mode: Optional[Union[str, "PatchModeTypes"]] = None, + **kwargs + ): + super(OsProfileWindowsConfiguration, self).__init__(**kwargs) + self.assessment_mode = assessment_mode + self.patch_mode = patch_mode class PrivateEndpointConnection(Resource): @@ -1343,6 +1564,47 @@ def __init__( self.system_data = None +class PrivateEndpointConnectionDataModel(msrest.serialization.Model): + """The Data Model for a Private Endpoint Connection associated with a Private Link Scope. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM Resource Id of the Private Endpoint. + :vartype id: str + :ivar name: The Name of the Private Endpoint. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param properties: The Private Endpoint Connection properties. + :type properties: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + } + + def __init__( + self, + *, + properties: Optional["PrivateEndpointConnectionProperties"] = None, + **kwargs + ): + super(PrivateEndpointConnectionDataModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. @@ -1386,16 +1648,20 @@ class PrivateEndpointConnectionProperties(msrest.serialization.Model): ~azure.mgmt.hybridcompute.models.PrivateLinkServiceConnectionStateProperty :ivar provisioning_state: State of the private endpoint connection. :vartype provisioning_state: str + :ivar group_ids: List of group IDs. + :vartype group_ids: list[str] """ _validation = { 'provisioning_state': {'readonly': True}, + 'group_ids': {'readonly': True}, } _attribute_map = { 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointProperty'}, 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'group_ids': {'key': 'groupIds', 'type': '[str]'}, } def __init__( @@ -1409,6 +1675,7 @@ def __init__( self.private_endpoint = private_endpoint self.private_link_service_connection_state = private_link_service_connection_state self.provisioning_state = None + self.group_ids = None class PrivateEndpointProperty(msrest.serialization.Model): @@ -1654,6 +1921,59 @@ def __init__( super(ProxyResource, self).__init__(**kwargs) +class ServiceStatus(msrest.serialization.Model): + """Describes the status and behavior of a service. + + :param status: The current status of the service. + :type status: str + :param startup_type: The behavior of the service when the Arc-enabled machine starts up. + :type startup_type: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'startup_type': {'key': 'startupType', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + startup_type: Optional[str] = None, + **kwargs + ): + super(ServiceStatus, self).__init__(**kwargs) + self.status = status + self.startup_type = startup_type + + +class ServiceStatuses(msrest.serialization.Model): + """Reports the state and behavior of dependent services. + + :param extension_service: The state of the extension service on the Arc-enabled machine. + :type extension_service: ~azure.mgmt.hybridcompute.models.ServiceStatus + :param guest_configuration_service: The state of the guest configuration service on the Arc- + enabled machine. + :type guest_configuration_service: ~azure.mgmt.hybridcompute.models.ServiceStatus + """ + + _attribute_map = { + 'extension_service': {'key': 'extensionService', 'type': 'ServiceStatus'}, + 'guest_configuration_service': {'key': 'guestConfigurationService', 'type': 'ServiceStatus'}, + } + + def __init__( + self, + *, + extension_service: Optional["ServiceStatus"] = None, + guest_configuration_service: Optional["ServiceStatus"] = None, + **kwargs + ): + super(ServiceStatuses, self).__init__(**kwargs) + self.extension_service = extension_service + self.guest_configuration_service = guest_configuration_service + + class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py index a3ba7e9ea79..5f958e2a2c3 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py @@ -39,7 +39,7 @@ def _upgrade_extensions_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -68,7 +68,7 @@ def _upgrade_extensions_initial( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py index 63bc7c881c3..d25ff8a68f0 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py @@ -61,7 +61,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -197,7 +197,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -332,7 +332,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -463,7 +463,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -527,7 +527,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machines_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machines_operations.py index 2c809786d69..07363987d22 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machines_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machines_operations.py @@ -68,7 +68,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -128,7 +128,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -188,7 +188,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): @@ -258,7 +258,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operations.py index d5605a36454..05a1c555a5f 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py index 48c2e530400..d3cbcd3d380 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py @@ -73,7 +73,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -125,7 +125,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -260,7 +260,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -388,7 +388,7 @@ def list_by_private_link_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py index 07efc46cf79..b3da8697616 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py @@ -68,7 +68,7 @@ def list_by_private_link_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): @@ -147,7 +147,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py index 547e69394c8..416b5f99784 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py @@ -64,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): @@ -135,7 +135,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" def prepare_request(next_link=None): @@ -199,7 +199,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -321,7 +321,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -386,7 +386,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -460,7 +460,7 @@ def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -525,7 +525,7 @@ def get_validation_details( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL @@ -586,7 +586,7 @@ def get_validation_details_for_machine( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-20" + api_version = "2022-03-10" accept = "application/json" # Construct URL diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/setup.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/setup.py deleted file mode 100644 index f0a42bc98f8..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# coding: utf-8 - -from setuptools import setup, find_packages - -NAME = "azure-mgmt-hybridcompute" -VERSION = "1.0.0b1" - -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["msrest>=0.6.18", "azure-core<2.0.0,>=1.8.2", "azure-mgmt-core<2.0.0,>=1.2.1"] - -setup( - name=NAME, - version=VERSION, - description="azure-mgmt-hybridcompute", - author_email="", - url="", - keywords=["Swagger", "ConnectedMachine"], - install_requires=REQUIRES, - packages=find_packages(), - include_package_data=True, - long_description="""\ - The Hybrid Compute Management Client. - """ -) diff --git a/src/connectedmachine/report.md b/src/connectedmachine/report.md index ac7b1f45059..dd8f0cd8b15 100644 --- a/src/connectedmachine/report.md +++ b/src/connectedmachine/report.md @@ -179,6 +179,7 @@ az connectedmachine extension create --name "CustomScriptExtension" --location " |**--publisher**|string|The name of the extension handler publisher.|publisher|publisher| |**--type**|string|Specifies the type of the extension; an example is "CustomScriptExtension".|type|type| |**--type-handler-version**|string|Specifies the version of the script handler.|type_handler_version|typeHandlerVersion| +|**--enable-auto-upgrade**|boolean|Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available.|enable_auto_upgrade|enableAutomaticUpgrade| |**--auto-upgrade-minor**|boolean|Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.|auto_upgrade_minor|autoUpgradeMinorVersion| |**--settings**|any|Json formatted public settings for the extension.|settings|settings| |**--protected-settings**|any|The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.|protected_settings|protectedSettings| @@ -207,7 +208,6 @@ $_.CPU -lt 100 }\\\\\\"\\"}" --type-handler-version "1.10" --machine-name "myMac |**--publisher**|string|The name of the extension handler publisher.|publisher|publisher| |**--type**|string|Specifies the type of the extension; an example is "CustomScriptExtension".|type|type| |**--type-handler-version**|string|Specifies the version of the script handler.|type_handler_version|typeHandlerVersion| -|**--enable-auto-upgrade**|boolean|Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available.|enable_auto_upgrade|enableAutomaticUpgrade| |**--auto-upgrade-minor**|boolean|Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.|auto_upgrade_minor|autoUpgradeMinorVersion| |**--settings**|any|Json formatted public settings for the extension.|settings|settings| |**--protected-settings**|any|The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.|protected_settings|protectedSettings| diff --git a/src/connectedmachine/setup.py b/src/connectedmachine/setup.py index 2248468b82f..64d52b0dbe6 100644 --- a/src/connectedmachine/setup.py +++ b/src/connectedmachine/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # HISTORY.rst entry. -VERSION = '0.4.1' +VERSION = '0.5.0' try: from azext_connectedmachine.manual.version import VERSION except ImportError: diff --git a/src/containerapp/HISTORY.rst b/src/containerapp/HISTORY.rst index 2a1a1d2fc27..34788d4681c 100644 --- a/src/containerapp/HISTORY.rst +++ b/src/containerapp/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.3.3 +++++++ +* Improved 'az containerapp up' handling of environment locations +* Added 'az containerapp env storage' to manage Container App environment file shares 0.3.2 ++++++ diff --git a/src/containerapp/azext_containerapp/_clients.py b/src/containerapp/azext_containerapp/_clients.py index 4362e1d51aa..d217e12be5e 100644 --- a/src/containerapp/azext_containerapp/_clients.py +++ b/src/containerapp/azext_containerapp/_clients.py @@ -14,7 +14,6 @@ logger = get_logger(__name__) -API_VERSION = "2021-03-01" PREVIEW_API_VERSION = "2022-01-01-preview" STABLE_API_VERSION = "2022-03-01" POLLING_TIMEOUT = 60 # how many seconds before exiting @@ -74,7 +73,7 @@ class ContainerAppClient(): @classmethod def create_or_update(cls, cmd, resource_group_name, name, container_app_envelope, no_wait=False): management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager - api_version = PREVIEW_API_VERSION + api_version = STABLE_API_VERSION sub_id = get_subscription_id(cmd.cli_ctx) url_fmt = "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}?api-version={}" request_url = url_fmt.format( diff --git a/src/containerapp/azext_containerapp/_constants.py b/src/containerapp/azext_containerapp/_constants.py index d6852056fce..62e655754b0 100644 --- a/src/containerapp/azext_containerapp/_constants.py +++ b/src/containerapp/azext_containerapp/_constants.py @@ -8,3 +8,7 @@ SHORT_POLLING_INTERVAL_SECS = 3 LONG_POLLING_INTERVAL_SECS = 10 + +LOG_ANALYTICS_RP = "Microsoft.OperationalInsights" + +MAX_ENV_PER_LOCATION = 2 diff --git a/src/containerapp/azext_containerapp/_ssh_utils.py b/src/containerapp/azext_containerapp/_ssh_utils.py index 057216a321f..c37ad199f75 100644 --- a/src/containerapp/azext_containerapp/_ssh_utils.py +++ b/src/containerapp/azext_containerapp/_ssh_utils.py @@ -58,7 +58,7 @@ def __init__(self, cmd, resource_group_name, name, revision, replica, container, self._url = self._get_url(cmd=cmd, resource_group_name=resource_group_name, name=name, revision=revision, replica=replica, container=container, startup_command=startup_command) self._socket = websocket.WebSocket(enable_multithread=True) - logger.warning("Attempting to connect to %s", self._url) + logger.info("Attempting to connect to %s", self._url) self._socket.connect(self._url, header=[f"Authorization: Bearer {self._token}"]) self.is_connected = True @@ -160,9 +160,12 @@ def _getch_windows(): def ping_container_app(app): site = safe_get(app, "properties", "configuration", "ingress", "fqdn") if site: - resp = requests.get(f'https://{site}') - if not resp.ok: - logger.info(f"Got bad status pinging app: {resp.status_code}") + try: + resp = requests.get(f'https://{site}', timeout=30) + if not resp.ok: + logger.info(f"Got bad status pinging app: {resp.status_code}") + except requests.exceptions.ReadTimeout: + logger.info("Timed out while pinging app external URL") else: logger.info("Could not fetch site external URL") diff --git a/src/containerapp/azext_containerapp/_up_utils.py b/src/containerapp/azext_containerapp/_up_utils.py index 013baabc681..fae718932c0 100644 --- a/src/containerapp/azext_containerapp/_up_utils.py +++ b/src/containerapp/azext_containerapp/_up_utils.py @@ -41,10 +41,13 @@ create_service_principal_for_rbac, repo_url_to_name, get_container_app_if_exists, - trigger_workflow + trigger_workflow, + _ensure_location_allowed, + _is_resource_provider_registered, + _register_resource_provider ) -from ._constants import MAXIMUM_SECRET_LENGTH +from ._constants import MAXIMUM_SECRET_LENGTH, LOG_ANALYTICS_RP from .custom import ( create_managed_environment, @@ -62,6 +65,8 @@ def __init__(self, cmd, name: str, location: str, exists: bool = None): self.cmd = cmd self.name = name self.location = _get_default_containerapps_location(cmd, location) + if self.location.lower() == "northcentralusstage": + self.location = "eastus" self.exists = exists self.check_exists() @@ -151,7 +156,7 @@ def __init__( rg = parse_resource_id(name)["resource_group"] if resource_group.name != rg: self.resource_group = ResourceGroup(cmd, rg, location) - self.location = _get_default_containerapps_location(cmd, location) + self.location = location self.logs_key = logs_key self.logs_customer_id = logs_customer_id @@ -164,7 +169,7 @@ def set_name(self, name_or_rid): self.resource_group = ResourceGroup( self.cmd, rg, - _get_default_containerapps_location(self.cmd, self.location), + self.location, ) else: self.name = name_or_rid @@ -188,6 +193,9 @@ def create_if_needed(self, app_name): ) # TODO use .info() def create(self): + self.location = validate_environment_location(self.cmd, self.location) + if not _is_resource_provider_registered(self.cmd, LOG_ANALYTICS_RP): + _register_resource_provider(self.cmd, LOG_ANALYTICS_RP) env = create_managed_environment( self.cmd, self.name, @@ -290,8 +298,11 @@ def create_acr(self): registry_rg = self.resource_group url = self.registry_server registry_name = url[: url.rindex(".azurecr.io")] + location = "eastus" + if self.env.location and self.env.location.lower() != "northcentralusstage": + location = self.env.location registry_def = create_new_acr( - self.cmd, registry_name, registry_rg.name, self.env.location + self.cmd, registry_name, registry_rg.name, location ) self.registry_server = registry_def.login_server @@ -435,7 +446,13 @@ def _get_ingress_and_target_port(ingress, target_port, dockerfile_content: "list return ingress, target_port -def _validate_up_args(source, image, repo, registry_server): +def _validate_up_args(cmd, source, image, repo, registry_server): + disallowed_params = ["--only-show-errors", "--output", "-o"] + command_args = cmd.cli_ctx.data.get("safe_params", []) + for a in disallowed_params: + if a in command_args: + raise ValidationError(f"Argument {a} is not allowed for 'az containerapp up'") + if not source and not image and not repo: raise RequiredArgumentMissingError( "You must specify either --source, --repo, or --image" @@ -782,3 +799,69 @@ def find_existing_acr(cmd, app: "ContainerApp"): app.should_create_acr = False return acr.name, parse_resource_id(acr.id)["resource_group"] return None, None + + +def validate_environment_location(cmd, location): + from ._constants import MAX_ENV_PER_LOCATION + env_list = list_managed_environments(cmd) + + locations = [l["location"] for l in env_list] + locations = list(set(locations)) # remove duplicates + + location_count = {} + for loc in locations: + location_count[loc] = len([e for e in env_list if e["location"] == loc]) + + disallowed_locations = [] + for _, value in enumerate(location_count): + if location_count[value] > MAX_ENV_PER_LOCATION - 1: + disallowed_locations.append(value) + + res_locations = list_environment_locations(cmd) + res_locations = [l for l in res_locations if l not in disallowed_locations] + + allowed_locs = ", ".join(res_locations) + + if location: + try: + _ensure_location_allowed(cmd, location, "Microsoft.App", "managedEnvironments") + except Exception: # pylint: disable=broad-except + raise ValidationError("You cannot create a Containerapp environment in location {}. List of eligible locations: {}.".format(location, allowed_locs)) + + if len(res_locations) > 0: + if not location: + logger.warning("Creating environment on location {}.".format(res_locations[0])) + return res_locations[0] + if location in disallowed_locations: + raise ValidationError("You have more than {} environments in location {}. List of eligible locations: {}.".format(MAX_ENV_PER_LOCATION, location, allowed_locs)) + return location + else: + raise ValidationError("You cannot create any more environments. Environments are limited to {} per location in a subscription. Please specify an existing environment using --environment.".format(MAX_ENV_PER_LOCATION)) + + +def list_environment_locations(cmd): + from ._utils import providers_client_factory + providers_client = providers_client_factory(cmd.cli_ctx, get_subscription_id(cmd.cli_ctx)) + resource_types = getattr(providers_client.get("Microsoft.App"), 'resource_types', []) + res_locations = [] + for res in resource_types: + if res and getattr(res, 'resource_type', "") == "managedEnvironments": + res_locations = getattr(res, 'locations', []) + + res_locations = [res_loc.lower().replace(" ", "").replace("(", "").replace(")", "") for res_loc in res_locations if res_loc.strip()] + + return res_locations + + +def check_env_name_on_rg(cmd, managed_env, resource_group_name, location): + if location: + _ensure_location_allowed(cmd, location, "Microsoft.App", "managedEnvironments") + if managed_env and resource_group_name and location: + env_def = None + try: + env_def = ManagedEnvironmentClient.show(cmd, resource_group_name, parse_resource_id(managed_env)["name"]) + except: + pass + if env_def: + if location != env_def["location"]: + raise ValidationError("Environment {} already exists in resource group {} on location {}, cannot change location of existing environment to {}.".format(parse_resource_id(managed_env)["name"], resource_group_name, env_def["location"], location)) diff --git a/src/containerapp/azext_containerapp/_utils.py b/src/containerapp/azext_containerapp/_utils.py index 06bb2054276..eb44906c87e 100644 --- a/src/containerapp/azext_containerapp/_utils.py +++ b/src/containerapp/azext_containerapp/_utils.py @@ -19,7 +19,8 @@ from ._clients import ContainerAppClient from ._client_factory import handle_raw_exception, providers_client_factory, cf_resource_groups, log_analytics_client_factory, log_analytics_shared_key_client_factory -from ._constants import MAXIMUM_CONTAINER_APP_NAME_LENGTH, SHORT_POLLING_INTERVAL_SECS, LONG_POLLING_INTERVAL_SECS +from ._constants import (MAXIMUM_CONTAINER_APP_NAME_LENGTH, SHORT_POLLING_INTERVAL_SECS, LONG_POLLING_INTERVAL_SECS, + LOG_ANALYTICS_RP) logger = get_logger(__name__) @@ -177,8 +178,9 @@ def get_workflow(github_repo, name): # pylint: disable=inconsistent-return-stat def trigger_workflow(token, repo, name, branch): - logger.warning("Triggering Github Action") - get_workflow(get_github_repo(token, repo), name).create_dispatch(branch) + wf = get_workflow(get_github_repo(token, repo), name) + logger.warning(f"Triggering Github Action: {wf.path}") + wf.create_dispatch(branch) def await_github_action(cmd, token, repo, branch, name, resource_group_name, timeout_secs=1200): @@ -254,22 +256,56 @@ def _get_location_from_resource_group(cli_ctx, resource_group_name): return group.location -def _validate_subscription_registered(cmd, resource_provider, subscription_id=None): - providers_client = None +def _register_resource_provider(cmd, resource_provider): + from azure.mgmt.resource.resources.models import ProviderRegistrationRequest, ProviderConsentDefinition + + logger.warning(f"Registering resource provider {resource_provider} ...") + properties = ProviderRegistrationRequest(third_party_provider_consent=ProviderConsentDefinition(consent_to_authorization=True)) + + client = providers_client_factory(cmd.cli_ctx) + try: + client.register(resource_provider, properties=properties) + # wait for registration to finish + timeout_secs = 120 + registration = _is_resource_provider_registered(cmd, resource_provider) + start = datetime.utcnow() + while not registration: + registration = _is_resource_provider_registered(cmd, resource_provider) + time.sleep(SHORT_POLLING_INTERVAL_SECS) + if (datetime.utcnow() - start).seconds >= timeout_secs: + raise CLIInternalError(f"Timed out while waiting for the {resource_provider} resource provider to be registered.") + + except Exception as e: + msg = ("This operation requires requires registering the resource provider {0}. " + "We were unable to perform that registration on your behalf: " + "Server responded with error message -- {1} . " + "Please check with your admin on permissions, " + "or try running registration manually with: az provider register --wait --namespace {0}") + raise ValidationError(resource_provider, msg.format(e.args)) from e + + +def _is_resource_provider_registered(cmd, resource_provider, subscription_id=None): + registered = None if not subscription_id: subscription_id = get_subscription_id(cmd.cli_ctx) - try: providers_client = providers_client_factory(cmd.cli_ctx, subscription_id) registration_state = getattr(providers_client.get(resource_provider), 'registration_state', "NotRegistered") - if not (registration_state and registration_state.lower() == 'registered'): - raise ValidationError('Subscription {} is not registered for the {} resource provider. Please run \"az provider register -n {} --wait\" to register your subscription.'.format( - subscription_id, resource_provider, resource_provider)) - except ValidationError as ex: - raise ex + registered = (registration_state and registration_state.lower() == 'registered') except Exception: # pylint: disable=broad-except pass + return registered + + +def _validate_subscription_registered(cmd, resource_provider, subscription_id=None): + if not subscription_id: + subscription_id = get_subscription_id(cmd.cli_ctx) + registered = _is_resource_provider_registered(cmd, resource_provider, subscription_id) + if registered is False: + raise ValidationError(f'Subscription {subscription_id} is not registered for the {resource_provider} ' + f'resource provider. Please run "az provider register -n {resource_provider} --wait" ' + 'to register your subscription.') def _ensure_location_allowed(cmd, location, resource_provider, resource_type): @@ -421,7 +457,7 @@ def _get_default_log_analytics_location(cmd): providers_client = None try: providers_client = providers_client_factory(cmd.cli_ctx, get_subscription_id(cmd.cli_ctx)) - resource_types = getattr(providers_client.get("Microsoft.OperationalInsights"), 'resource_types', []) + resource_types = getattr(providers_client.get(LOG_ANALYTICS_RP), 'resource_types', []) res_locations = [] for res in resource_types: if res and getattr(res, 'resource_type', "") == "workspaces": @@ -514,14 +550,14 @@ def _get_log_analytics_workspace_name(cmd, logs_customer_id, resource_group_name def _generate_log_analytics_if_not_provided(cmd, logs_customer_id, logs_key, location, resource_group_name): if logs_customer_id is None and logs_key is None: logger.warning("No Log Analytics workspace provided.") + _validate_subscription_registered(cmd, LOG_ANALYTICS_RP) try: - _validate_subscription_registered(cmd, "Microsoft.OperationalInsights") log_analytics_client = log_analytics_client_factory(cmd.cli_ctx) log_analytics_shared_key_client = log_analytics_shared_key_client_factory(cmd.cli_ctx) log_analytics_location = location try: - _ensure_location_allowed(cmd, log_analytics_location, "Microsoft.OperationalInsights", "workspaces") + _ensure_location_allowed(cmd, log_analytics_location, LOG_ANALYTICS_RP, "workspaces") except Exception: # pylint: disable=broad-except log_analytics_location = _get_default_log_analytics_location(cmd) @@ -819,8 +855,9 @@ def _update_traffic_weights(containerapp_def, list_weights): if not is_existing: containerapp_def["properties"]["configuration"]["ingress"]["traffic"].append({ - "revisionName": key_val[0], - "weight": int(key_val[1]) + "revisionName": key_val[0] if key_val[0].lower() != "latest" else None, + "weight": int(key_val[1]), + "latestRevision": key_val[0].lower() == "latest" }) diff --git a/src/containerapp/azext_containerapp/custom.py b/src/containerapp/azext_containerapp/custom.py index ce52bd8e5d8..4010086bbe8 100644 --- a/src/containerapp/azext_containerapp/custom.py +++ b/src/containerapp/azext_containerapp/custom.py @@ -1964,7 +1964,7 @@ def stream_containerapp_logs(cmd, resource_group_name, name, container=None, rev url = (f"{base_url}/subscriptions/{sub}/resourceGroups/{resource_group_name}/containerApps/{name}" f"/revisions/{revision}/replicas/{replica}/containers/{container}/logstream") - logger.warning("connecting to : %s", url) + logger.info("connecting to : %s", url) request_params = {"follow": str(follow).lower(), "output": output_format, "tailLines": tail} headers = {"Authorization": f"Bearer {token}"} resp = requests.get(url, timeout=None, stream=True, params=request_params, headers=headers) @@ -2015,12 +2015,14 @@ def containerapp_up(cmd, service_principal_tenant_id=None): from ._up_utils import (_validate_up_args, _reformat_image, _get_dockerfile_content, _get_ingress_and_target_port, ResourceGroup, ContainerAppEnvironment, ContainerApp, _get_registry_from_app, - _get_registry_details, _create_github_action, _set_up_defaults, up_output, AzureContainerRegistry) + _get_registry_details, _create_github_action, _set_up_defaults, up_output, AzureContainerRegistry, + check_env_name_on_rg) HELLOWORLD = "mcr.microsoft.com/azuredocs/containerapps-helloworld" dockerfile = "Dockerfile" # for now the dockerfile name must be "Dockerfile" (until GH actions API is updated) - _validate_up_args(source, image, repo, registry_server) + _validate_up_args(cmd, source, image, repo, registry_server) validate_container_app_name(name) + check_env_name_on_rg(cmd, managed_env, resource_group_name, location) image = _reformat_image(source, repo, image) token = None if not repo else get_github_access_token(cmd, ["admin:repo_hook", "repo", "workflow"], token) diff --git a/src/containerapp/azext_containerapp/tests/latest/test_containerapp_scenario.py b/src/containerapp/azext_containerapp/tests/latest/test_containerapp_scenario.py index f8b81030eeb..c438c4c53ba 100644 --- a/src/containerapp/azext_containerapp/tests/latest/test_containerapp_scenario.py +++ b/src/containerapp/azext_containerapp/tests/latest/test_containerapp_scenario.py @@ -7,6 +7,7 @@ import platform from unittest import mock import time +import unittest from azext_containerapp.custom import containerapp_ssh from azure.cli.testsdk.reverse_dependency import get_dummy_cli @@ -18,7 +19,7 @@ TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) -@live_only() +@live_only() # Containerapp tests can only be run live due to log analytics name being randomly generated every time class ContainerappScenarioTest(ScenarioTest): @AllowLargeResponse(8192) @ResourceGroupPreparer(location="eastus2") @@ -218,6 +219,30 @@ def test_container_acr(self, resource_group): JMESPathCheck('length(properties.configuration.secrets)', 1), ]) + # Update Container App with ACR + update_string = 'containerapp update -g {} -n {} --min-replicas 0 --max-replicas 1 --set-env-vars testenv=testing'.format( + resource_group, containerapp_name) + self.cmd(update_string, checks=[ + JMESPathCheck('name', containerapp_name), + JMESPathCheck('properties.configuration.registries[0].server', registry_server), + JMESPathCheck('properties.configuration.registries[0].username', registry_username), + JMESPathCheck('length(properties.configuration.secrets)', 1), + JMESPathCheck('properties.template.scale.minReplicas', '0'), + JMESPathCheck('properties.template.scale.maxReplicas', '1'), + JMESPathCheck('length(properties.template.containers[0].env)', 1), + ]) + + # Add secrets to Container App with ACR + containerapp_secret = self.cmd('containerapp secret list -g {} -n {}'.format(resource_group, containerapp_name)).get_output_in_json() + secret_name = containerapp_secret[0]["name"] + secret_string = 'containerapp secret set -g {} -n {} --secrets newsecret=test'.format(resource_group, containerapp_name) + self.cmd(secret_string, checks=[ + JMESPathCheck('length(@)', 2), + ]) + + with self.assertRaises(CLIError): + # Removing ACR password should fail since it is needed for ACR + self.cmd('containerapp secret remove -g {} -n {} --secret-names {}'.format(resource_group, containerapp_name, secret_name)) @AllowLargeResponse(8192) @ResourceGroupPreparer(location="eastus") @@ -286,6 +311,7 @@ def test_containerapp_update(self, resource_group): JMESPathCheck('properties.template.containers[1].resources.memory', '1.5Gi'), ]) + @unittest.skip("API only on stage currently") @live_only() # VCR.py can't seem to handle websockets (only --live works) # @ResourceGroupPreparer(location="centraluseuap") @mock.patch("azext_containerapp._ssh_utils._resize_terminal") @@ -358,4 +384,4 @@ def test_containerapp_logstream(self, resource_group): self.cmd(f'containerapp env create -g {resource_group} -n {env_name}') self.cmd(f'containerapp create -g {resource_group} -n {containerapp_name} --environment {env_name} --min-replicas 1 --ingress external --target-port 80') - self.cmd(f'containerapp log tail -n {containerapp_name} -g {resource_group}') + self.cmd(f'containerapp logs show -n {containerapp_name} -g {resource_group}') diff --git a/src/containerapp/setup.py b/src/containerapp/setup.py index d0f615849f3..ca2dd65ff30 100644 --- a/src/containerapp/setup.py +++ b/src/containerapp/setup.py @@ -17,7 +17,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.3.2' +VERSION = '0.3.3' # The full list of classifiers is available at diff --git a/src/dns-resolver/HISTORY.rst b/src/dns-resolver/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/dns-resolver/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/dns-resolver/README.md b/src/dns-resolver/README.md new file mode 100644 index 00000000000..381b19bbe61 --- /dev/null +++ b/src/dns-resolver/README.md @@ -0,0 +1,183 @@ +# Azure CLI dns-resolver Extension # +This is the extension for dns-resolver + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name dns-resolver +``` + +### Included Features ### +#### dns-resolver #### +##### Create ##### +``` +az dns-resolver create --name "sampleDnsResolver" --location "westus2" \ + --id "/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork" \ + --tags key1="value1" --resource-group "sampleResourceGroup" + +az dns-resolver wait --created --name "{myDnsResolver}" --resource-group "{rg}" +``` +##### Show ##### +``` +az dns-resolver show --name "sampleDnsResolver" --resource-group "sampleResourceGroup" +``` +##### List ##### +``` +az dns-resolver list --resource-group "sampleResourceGroup" +``` +##### Update ##### +``` +az dns-resolver update --name "sampleDnsResolver" --tags key1="value1" --resource-group "sampleResourceGroup" +``` +##### Delete ##### +``` +az dns-resolver delete --name "sampleDnsResolver" --resource-group "sampleResourceGroup" +``` +#### dns-resolver inbound-endpoint #### +##### Create ##### +``` +az dns-resolver inbound-endpoint create --dns-resolver-name "sampleDnsResolver" --name "sampleInboundEndpoint" \ + --location "westus2" \ + --ip-configurations private-ip-address="" private-ip-allocation-method="Dynamic" id="/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet" \ + --tags key1="value1" --resource-group "sampleResourceGroup" + +az dns-resolver inbound-endpoint wait --created --dns-resolver-name "{myDnsResolver}" --name "{myInboundEndpoint}" \ + --resource-group "{rg}" +``` +##### Show ##### +``` +az dns-resolver inbound-endpoint show --dns-resolver-name "sampleDnsResolver" --name "sampleInboundEndpoint" \ + --resource-group "sampleResourceGroup" +``` +##### List ##### +``` +az dns-resolver inbound-endpoint list --dns-resolver-name "sampleDnsResolver" --resource-group "sampleResourceGroup" +``` +##### Update ##### +``` +az dns-resolver inbound-endpoint update --dns-resolver-name "sampleDnsResolver" --name "sampleInboundEndpoint" \ + --tags key1="value1" --resource-group "sampleResourceGroup" +``` +##### Delete ##### +``` +az dns-resolver inbound-endpoint delete --dns-resolver-name "sampleDnsResolver" --name "sampleInboundEndpoint" \ + --resource-group "sampleResourceGroup" +``` +#### dns-resolver outbound-endpoint #### +##### Create ##### +``` +az dns-resolver outbound-endpoint create --dns-resolver-name "sampleDnsResolver" --name "sampleOutboundEndpoint" \ + --location "westus2" \ + --id "/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet" \ + --tags key1="value1" --resource-group "sampleResourceGroup" + +az dns-resolver outbound-endpoint wait --created --dns-resolver-name "{myDnsResolver}" --name "{myOutboundEndpoint}" \ + --resource-group "{rg}" +``` +##### Show ##### +``` +az dns-resolver outbound-endpoint show --dns-resolver-name "sampleDnsResolver" --name "sampleOutboundEndpoint" \ + --resource-group "sampleResourceGroup" +``` +##### List ##### +``` +az dns-resolver outbound-endpoint list --dns-resolver-name "sampleDnsResolver" --resource-group "sampleResourceGroup" +``` +##### Update ##### +``` +az dns-resolver outbound-endpoint update --dns-resolver-name "sampleDnsResolver" --name "sampleOutboundEndpoint" \ + --tags key1="value1" --resource-group "sampleResourceGroup" +``` +##### Delete ##### +``` +az dns-resolver outbound-endpoint delete --dns-resolver-name "sampleDnsResolver" --name "sampleOutboundEndpoint" \ + --resource-group "sampleResourceGroup" +``` +#### dns-resolver forwarding-ruleset #### +##### Create ##### +``` +az dns-resolver forwarding-ruleset create --name "samplednsForwardingRuleset" --location "westus2" \ + --outbound-endpoints id="/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint0" \ + --outbound-endpoints id="/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint1" \ + --tags key1="value1" --resource-group "sampleResourceGroup" + +az dns-resolver forwarding-ruleset wait --created --name "{myDnsForwardingRuleset2}" --resource-group "{rg}" +``` +##### Show ##### +``` +az dns-resolver forwarding-ruleset show --name "sampleDnsForwardingRuleset" --resource-group "sampleResourceGroup" +``` +##### List ##### +``` +az dns-resolver forwarding-ruleset list --resource-group "sampleResourceGroup" +``` +##### Update ##### +``` +az dns-resolver forwarding-ruleset update --name "sampleDnsForwardingRuleset" --tags key1="value1" \ + --resource-group "sampleResourceGroup" +``` +##### Delete ##### +``` +az dns-resolver forwarding-ruleset delete --name "samplednsForwardingRulesetName" \ + --resource-group "sampleResourceGroup" +``` +#### dns-resolver forwarding-rule #### +##### Create ##### +``` +az dns-resolver forwarding-rule create --ruleset-name "sampleDnsForwardingRuleset" \ + --name "sampleForwardingRule" --domain-name "contoso.com." --forwarding-rule-state "Enabled" \ + --metadata additionalProp1="value1" --target-dns-servers ip-address="10.0.0.1" port=53 \ + --target-dns-servers ip-address="10.0.0.2" port=53 --resource-group "sampleResourceGroup" +``` +##### Show ##### +``` +az dns-resolver forwarding-rule show --ruleset-name "sampleDnsForwardingRuleset" \ + --name "sampleForwardingRule" --resource-group "sampleResourceGroup" +``` +##### List ##### +``` +az dns-resolver forwarding-rule list --ruleset-name "sampleDnsForwardingRuleset" \ + --resource-group "sampleResourceGroup" +``` +##### Update ##### +``` +az dns-resolver forwarding-rule update --ruleset-name "sampleDnsForwardingRuleset" \ + --name "sampleForwardingRule" --forwarding-rule-state "Disabled" --metadata additionalProp2="value2" \ + --resource-group "sampleResourceGroup" +``` +##### Delete ##### +``` +az dns-resolver forwarding-rule delete --ruleset-name "sampleDnsForwardingRuleset" \ + --name "sampleForwardingRule" --resource-group "sampleResourceGroup" +``` +#### dns-resolver virtual-network-link #### +##### Create ##### +``` +az dns-resolver vnet-link create --ruleset-name "sampleDnsForwardingRuleset" \ + --metadata additionalProp1="value1" \ + --id "/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork" \ + --resource-group "sampleResourceGroup" --name "sampleVirtualNetworkLink" + +az dns-resolver vnet-link wait --created --ruleset-name "{myDnsForwardingRuleset}" \ + --resource-group "{rg}" --name "{myVirtualNetworkLink}" +``` +##### Show ##### +``` +az dns-resolver vnet-link show --ruleset-name "sampleDnsForwardingRuleset" \ + --resource-group "sampleResourceGroup" --name "sampleVirtualNetworkLink" +``` +##### List ##### +``` +az dns-resolver vnet-link list --ruleset-name "sampleDnsForwardingRuleset" \ + --resource-group "sampleResourceGroup" +``` +##### Update ##### +``` +az dns-resolver vnet-link update --ruleset-name "sampleDnsForwardingRuleset" \ + --metadata additionalProp1="value1" --resource-group "sampleResourceGroup" --name "sampleVirtualNetworkLink" +``` +##### Delete ##### +``` +az dns-resolver vnet-link delete --ruleset-name "sampleDnsForwardingRuleset" \ + --resource-group "sampleResourceGroup" --name "sampleVirtualNetworkLink" +``` \ No newline at end of file diff --git a/src/dns-resolver/azext_dnsresolver/__init__.py b/src/dns-resolver/azext_dnsresolver/__init__.py new file mode 100644 index 00000000000..e820c78ac2b --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/__init__.py @@ -0,0 +1,53 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=unused-import + +import azext_dnsresolver._help +from azure.cli.core import AzCommandsLoader + + +class DnsResolverManagementClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_dnsresolver.generated._client_factory import cf_dns_resolver_cl + dns_resolver_custom = CliCommandType( + operations_tmpl='azext_dnsresolver.custom#{}', + client_factory=cf_dns_resolver_cl) + parent = super() + parent.__init__(cli_ctx=cli_ctx, custom_command_type=dns_resolver_custom) + + def load_command_table(self, args): + from azext_dnsresolver.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_dnsresolver.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError as e: + if e.name.endswith('manual.commands'): + pass + else: + raise e + return self.command_table + + def load_arguments(self, command): + from azext_dnsresolver.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_dnsresolver.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError as e: + if e.name.endswith('manual._params'): + pass + else: + raise e + + +COMMAND_LOADER_CLS = DnsResolverManagementClientCommandsLoader diff --git a/src/dns-resolver/azext_dnsresolver/_help.py b/src/dns-resolver/azext_dnsresolver/_help.py new file mode 100644 index 00000000000..9b93f87a6e9 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/_help.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import +# pylint: disable=unused-import +from .generated._help import helps # pylint: disable=reimported +try: + from .manual._help import helps # pylint: disable=reimported +except ImportError as e: + if e.name.endswith('manual._help'): + pass + else: + raise e diff --git a/src/dns-resolver/azext_dnsresolver/action.py b/src/dns-resolver/azext_dnsresolver/action.py new file mode 100644 index 00000000000..9b3d0a8a78c --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/action.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError as e: + if e.name.endswith('manual.action'): + pass + else: + raise e diff --git a/src/dns-resolver/azext_dnsresolver/azext_metadata.json b/src/dns-resolver/azext_dnsresolver/azext_metadata.json new file mode 100644 index 00000000000..30fdaf614ee --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.15.0" +} \ No newline at end of file diff --git a/src/dns-resolver/azext_dnsresolver/custom.py b/src/dns-resolver/azext_dnsresolver/custom.py new file mode 100644 index 00000000000..885447229d6 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/custom.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError as e: + if e.name.endswith('manual.custom'): + pass + else: + raise e diff --git a/src/dns-resolver/azext_dnsresolver/generated/__init__.py b/src/dns-resolver/azext_dnsresolver/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/generated/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/dns-resolver/azext_dnsresolver/generated/_client_factory.py b/src/dns-resolver/azext_dnsresolver/generated/_client_factory.py new file mode 100644 index 00000000000..ffa9457a180 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/generated/_client_factory.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +def cf_dns_resolver_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_dnsresolver.vendored_sdks.dnsresolver import DnsResolverManagementClient + return get_mgmt_service_client(cli_ctx, + DnsResolverManagementClient) + + +def cf_dns_resolver(cli_ctx, *_): + return cf_dns_resolver_cl(cli_ctx).dns_resolvers + + +def cf_inbound_endpoint(cli_ctx, *_): + return cf_dns_resolver_cl(cli_ctx).inbound_endpoints + + +def cf_outbound_endpoint(cli_ctx, *_): + return cf_dns_resolver_cl(cli_ctx).outbound_endpoints + + +def cf_dns_forwarding_ruleset(cli_ctx, *_): + return cf_dns_resolver_cl(cli_ctx).dns_forwarding_rulesets + + +def cf_forwarding_rule(cli_ctx, *_): + return cf_dns_resolver_cl(cli_ctx).forwarding_rules + + +def cf_virtual_network_link(cli_ctx, *_): + return cf_dns_resolver_cl(cli_ctx).virtual_network_links diff --git a/src/dns-resolver/azext_dnsresolver/generated/_help.py b/src/dns-resolver/azext_dnsresolver/generated/_help.py new file mode 100644 index 00000000000..da3dd3629ce --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/generated/_help.py @@ -0,0 +1,506 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['dns-resolver'] = ''' + type: group + short-summary: Manage Dns Resolver +''' + +helps['dns-resolver list'] = """ + type: command + short-summary: "Lists DNS resolver resource IDs linked to a virtual network. And Lists DNS resolvers within a \ +resource group. And Lists DNS resolvers in all resource groups of a subscription." + examples: + - name: List DNS resolvers by virtual network + text: |- + az dns-resolver list --resource-group "sampleResourceGroup" --virtual-network-name \ +"sampleVirtualNetwork" + - name: List DNS resolvers by resource group + text: |- + az dns-resolver list --resource-group "sampleResourceGroup" + - name: List DNS resolvers by subscription + text: |- + az dns-resolver list +""" + +helps['dns-resolver show'] = """ + type: command + short-summary: "Gets properties of a DNS resolver." + examples: + - name: Retrieve DNS resolver + text: |- + az dns-resolver show --name "sampleDnsResolver" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver create'] = """ + type: command + short-summary: "Create a DNS resolver." + examples: + - name: Upsert DNS resolver + text: |- + az dns-resolver create --name "sampleDnsResolver" --location "westus2" --id \ +"/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Net\ +work/virtualNetworks/sampleVirtualNetwork" --tags key1="value1" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver update'] = """ + type: command + short-summary: "Updates a DNS resolver." + examples: + - name: Update DNS resolver + text: |- + az dns-resolver update --name "sampleDnsResolver" --tags key1="value1" --resource-group \ +"sampleResourceGroup" +""" + +helps['dns-resolver delete'] = """ + type: command + short-summary: "Deletes a DNS resolver. WARNING: This operation cannot be undone." + examples: + - name: Delete DNS resolver + text: |- + az dns-resolver delete --name "sampleDnsResolver" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the dns-resolver is met. + examples: + - name: Pause executing next line of CLI script until the dns-resolver is successfully created. + text: |- + az dns-resolver wait --name "sampleDnsResolver" --resource-group "sampleResourceGroup" --created + - name: Pause executing next line of CLI script until the dns-resolver is successfully updated. + text: |- + az dns-resolver wait --name "sampleDnsResolver" --resource-group "sampleResourceGroup" --updated + - name: Pause executing next line of CLI script until the dns-resolver is successfully deleted. + text: |- + az dns-resolver wait --name "sampleDnsResolver" --resource-group "sampleResourceGroup" --deleted +""" + +helps['dns-resolver inbound-endpoint'] = """ + type: group + short-summary: Manage inbound endpoint with dns resolver +""" + +helps['dns-resolver inbound-endpoint list'] = """ + type: command + short-summary: "Lists inbound endpoints for a DNS resolver." + examples: + - name: List inbound endpoints by DNS resolver + text: |- + az dns-resolver inbound-endpoint list --dns-resolver-name "sampleDnsResolver" --resource-group \ +"sampleResourceGroup" +""" + +helps['dns-resolver inbound-endpoint show'] = """ + type: command + short-summary: "Gets properties of an inbound endpoint for a DNS resolver." + examples: + - name: Retrieve inbound endpoint for DNS resolver + text: |- + az dns-resolver inbound-endpoint show --dns-resolver-name "sampleDnsResolver" --name \ +"sampleInboundEndpoint" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver inbound-endpoint create'] = """ + type: command + short-summary: "Create an inbound endpoint for a DNS resolver." + parameters: + - name: --ip-configurations + short-summary: "IP configurations for the inbound endpoint." + long-summary: | + Usage: --ip-configurations private-ip-address=XX private-ip-allocation-method=XX id=XX + + private-ip-address: Private IP address of the IP configuration. + private-ip-allocation-method: Private IP address allocation method. + id: Resource ID. + + Multiple actions can be specified by using more than one --ip-configurations argument. + examples: + - name: Upsert inbound endpoint for DNS resolver + text: |- + az dns-resolver inbound-endpoint create --dns-resolver-name "sampleDnsResolver" --name \ +"sampleInboundEndpoint" --location "westus2" --ip-configurations private-ip-address="255.255.255.255" \ +private-ip-allocation-method="Static" id="/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnet\ +ResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet" --tags \ +key1="value1" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver inbound-endpoint update'] = """ + type: command + short-summary: "Updates an inbound endpoint for a DNS resolver." + examples: + - name: Update inbound endpoint for DNS resolver + text: |- + az dns-resolver inbound-endpoint update --dns-resolver-name "sampleDnsResolver" --name \ +"sampleInboundEndpoint" --tags key1="value1" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver inbound-endpoint delete'] = """ + type: command + short-summary: "Deletes an inbound endpoint for a DNS resolver. WARNING: This operation cannot be undone." + examples: + - name: Delete inbound endpoint for DNS resolver + text: |- + az dns-resolver inbound-endpoint delete --dns-resolver-name "sampleDnsResolver" --name \ +"sampleInboundEndpoint" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver inbound-endpoint wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the dns-resolver inbound-endpoint is met. + examples: + - name: Pause executing next line of CLI script until the dns-resolver inbound-endpoint is successfully created. + text: |- + az dns-resolver inbound-endpoint wait --dns-resolver-name "sampleDnsResolver" --name \ +"sampleInboundEndpoint" --resource-group "sampleResourceGroup" --created + - name: Pause executing next line of CLI script until the dns-resolver inbound-endpoint is successfully updated. + text: |- + az dns-resolver inbound-endpoint wait --dns-resolver-name "sampleDnsResolver" --name \ +"sampleInboundEndpoint" --resource-group "sampleResourceGroup" --updated + - name: Pause executing next line of CLI script until the dns-resolver inbound-endpoint is successfully deleted. + text: |- + az dns-resolver inbound-endpoint wait --dns-resolver-name "sampleDnsResolver" --name \ +"sampleInboundEndpoint" --resource-group "sampleResourceGroup" --deleted +""" + +helps['dns-resolver outbound-endpoint'] = """ + type: group + short-summary: Manage outbound endpoint with dns resolver +""" + +helps['dns-resolver outbound-endpoint list'] = """ + type: command + short-summary: "Lists outbound endpoints for a DNS resolver." + examples: + - name: List outbound endpoints by DNS resolver + text: |- + az dns-resolver outbound-endpoint list --dns-resolver-name "sampleDnsResolver" --resource-group \ +"sampleResourceGroup" +""" + +helps['dns-resolver outbound-endpoint show'] = """ + type: command + short-summary: "Gets properties of an outbound endpoint for a DNS resolver." + examples: + - name: Retrieve outbound endpoint for DNS resolver + text: |- + az dns-resolver outbound-endpoint show --dns-resolver-name "sampleDnsResolver" --name \ +"sampleOutboundEndpoint" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver outbound-endpoint create'] = """ + type: command + short-summary: "Create an outbound endpoint for a DNS resolver." + examples: + - name: Upsert outbound endpoint for DNS resolver + text: |- + az dns-resolver outbound-endpoint create --dns-resolver-name "sampleDnsResolver" --name \ +"sampleOutboundEndpoint" --location "westus2" --id "/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/\ +sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet" \ +--tags key1="value1" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver outbound-endpoint update'] = """ + type: command + short-summary: "Updates an outbound endpoint for a DNS resolver." + examples: + - name: Update outbound endpoint for DNS resolver + text: |- + az dns-resolver outbound-endpoint update --dns-resolver-name "sampleDnsResolver" --name \ +"sampleOutboundEndpoint" --tags key1="value1" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver outbound-endpoint delete'] = """ + type: command + short-summary: "Deletes an outbound endpoint for a DNS resolver. WARNING: This operation cannot be undone." + examples: + - name: Delete outbound endpoint for DNS resolver + text: |- + az dns-resolver outbound-endpoint delete --dns-resolver-name "sampleDnsResolver" --name \ +"sampleOutboundEndpoint" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver outbound-endpoint wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the dns-resolver outbound-endpoint is met. + examples: + - name: Pause executing next line of CLI script until the dns-resolver outbound-endpoint is successfully \ +created. + text: |- + az dns-resolver outbound-endpoint wait --dns-resolver-name "sampleDnsResolver" --name \ +"sampleOutboundEndpoint" --resource-group "sampleResourceGroup" --created + - name: Pause executing next line of CLI script until the dns-resolver outbound-endpoint is successfully \ +updated. + text: |- + az dns-resolver outbound-endpoint wait --dns-resolver-name "sampleDnsResolver" --name \ +"sampleOutboundEndpoint" --resource-group "sampleResourceGroup" --updated + - name: Pause executing next line of CLI script until the dns-resolver outbound-endpoint is successfully \ +deleted. + text: |- + az dns-resolver outbound-endpoint wait --dns-resolver-name "sampleDnsResolver" --name \ +"sampleOutboundEndpoint" --resource-group "sampleResourceGroup" --deleted +""" + +helps['dns-resolver forwarding-ruleset'] = """ + type: group + short-summary: Manage forwarding ruleset with dns resolver +""" + +helps['dns-resolver forwarding-ruleset list'] = """ + type: command + short-summary: "Lists DNS forwarding ruleset resource IDs attached to a virtual network. And Lists DNS forwarding \ +rulesets within a resource group. And Lists DNS forwarding rulesets in all resource groups of a subscription." + examples: + - name: List DNS forwarding rulesets by virtual network + text: |- + az dns-resolver forwarding-ruleset list --resource-group "sampleResourceGroup" --virtual-network-name \ +"sampleVirtualNetwork" + - name: List DNS forwarding rulesets by resource group + text: |- + az dns-resolver forwarding-ruleset list --resource-group "sampleResourceGroup" + - name: List DNS forwarding rulesets by subscription + text: |- + az dns-resolver forwarding-ruleset list +""" + +helps['dns-resolver forwarding-ruleset show'] = """ + type: command + short-summary: "Gets a DNS forwarding ruleset properties." + examples: + - name: Retrieve DNS forwarding ruleset + text: |- + az dns-resolver forwarding-ruleset show --name "sampleDnsForwardingRuleset" --resource-group \ +"sampleResourceGroup" +""" + +helps['dns-resolver forwarding-ruleset create'] = """ + type: command + short-summary: "Create a DNS forwarding ruleset." + parameters: + - name: --outbound-endpoints + short-summary: "The reference to the DNS resolver outbound endpoints that are used to route DNS queries \ +matching the forwarding rules in the ruleset to the target DNS servers." + long-summary: | + Usage: --outbound-endpoints id=XX + + id: Resource ID. + + Multiple actions can be specified by using more than one --outbound-endpoints argument. + examples: + - name: Upsert DNS forwarding ruleset + text: |- + az dns-resolver forwarding-ruleset create --name "samplednsForwardingRuleset" --location "westus2" \ +--outbound-endpoints id="/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/provide\ +rs/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint0" --outbound-endpoints \ +id="/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/\ +dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint1" --tags key1="value1" --resource-group \ +"sampleResourceGroup" +""" + +helps['dns-resolver forwarding-ruleset update'] = """ + type: command + short-summary: "Updates a DNS forwarding ruleset." + examples: + - name: Update DNS forwarding ruleset + text: |- + az dns-resolver forwarding-ruleset update --name "sampleDnsForwardingRuleset" --tags key1="value1" \ +--resource-group "sampleResourceGroup" +""" + +helps['dns-resolver forwarding-ruleset delete'] = """ + type: command + short-summary: "Deletes a DNS forwarding ruleset. WARNING: This operation cannot be undone. All forwarding rules \ +within the ruleset will be deleted." + examples: + - name: Delete DNS forwarding ruleset + text: |- + az dns-resolver forwarding-ruleset delete --name "samplednsForwardingRulesetName" --resource-group \ +"sampleResourceGroup" +""" + +helps['dns-resolver forwarding-ruleset wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the dns-resolver forwarding-ruleset is met. + examples: + - name: Pause executing next line of CLI script until the dns-resolver forwarding-ruleset is successfully \ +created. + text: |- + az dns-resolver forwarding-ruleset wait --name "sampleDnsForwardingRuleset" --resource-group \ +"sampleResourceGroup" --created + - name: Pause executing next line of CLI script until the dns-resolver forwarding-ruleset is successfully \ +updated. + text: |- + az dns-resolver forwarding-ruleset wait --name "sampleDnsForwardingRuleset" --resource-group \ +"sampleResourceGroup" --updated + - name: Pause executing next line of CLI script until the dns-resolver forwarding-ruleset is successfully \ +deleted. + text: |- + az dns-resolver forwarding-ruleset wait --name "sampleDnsForwardingRuleset" --resource-group \ +"sampleResourceGroup" --deleted +""" + +helps['dns-resolver forwarding-rule'] = """ + type: group + short-summary: Manage forwarding rule with dns resolver +""" + +helps['dns-resolver forwarding-rule list'] = """ + type: command + short-summary: "Lists forwarding rules in a DNS forwarding ruleset." + examples: + - name: List forwarding rules in a DNS forwarding ruleset + text: |- + az dns-resolver forwarding-rule list --ruleset-name "sampleDnsForwardingRuleset" --resource-group \ +"sampleResourceGroup" +""" + +helps['dns-resolver forwarding-rule show'] = """ + type: command + short-summary: "Gets properties of a forwarding rule in a DNS forwarding ruleset." + examples: + - name: Retrieve forwarding rule in a DNS forwarding ruleset + text: |- + az dns-resolver forwarding-rule show --ruleset-name "sampleDnsForwardingRuleset" --name \ +"sampleForwardingRule" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver forwarding-rule create'] = """ + type: command + short-summary: "Create a forwarding rule in a DNS forwarding ruleset." + parameters: + - name: --target-dns-servers + short-summary: "DNS servers to forward the DNS query to." + long-summary: | + Usage: --target-dns-servers ip-address=XX port=XX + + ip-address: DNS server IP address. + port: DNS server port. + + Multiple actions can be specified by using more than one --target-dns-servers argument. + examples: + - name: Upsert forwarding rule in a DNS forwarding ruleset + text: |- + az dns-resolver forwarding-rule create --ruleset-name "sampleDnsForwardingRuleset" --name \ +"sampleForwardingRule" --domain-name "contoso.com." --forwarding-rule-state "Enabled" --metadata \ +additionalProp1="value1" --target-dns-servers ip-address="10.0.0.1" port=53 --target-dns-servers ip-address="10.0.0.2" \ +port=53 --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver forwarding-rule update'] = """ + type: command + short-summary: "Updates a forwarding rule in a DNS forwarding ruleset." + parameters: + - name: --target-dns-servers + short-summary: "DNS servers to forward the DNS query to." + long-summary: | + Usage: --target-dns-servers ip-address=XX port=XX + + ip-address: DNS server IP address. + port: DNS server port. + + Multiple actions can be specified by using more than one --target-dns-servers argument. + examples: + - name: Update forwarding rule in a DNS forwarding ruleset + text: |- + az dns-resolver forwarding-rule update --ruleset-name "sampleDnsForwardingRuleset" --name \ +"sampleForwardingRule" --forwarding-rule-state "Disabled" --metadata additionalProp2="value2" --resource-group \ +"sampleResourceGroup" +""" + +helps['dns-resolver forwarding-rule delete'] = """ + type: command + short-summary: "Deletes a forwarding rule in a DNS forwarding ruleset. WARNING: This operation cannot be undone." + examples: + - name: Delete forwarding rule in a DNS forwarding ruleset + text: |- + az dns-resolver forwarding-rule delete --ruleset-name "sampleDnsForwardingRuleset" --name \ +"sampleForwardingRule" --resource-group "sampleResourceGroup" +""" + +helps['dns-resolver vnet-link'] = """ + type: group + short-summary: Manage vnet link with dns resolver +""" + +helps['dns-resolver vnet-link list'] = """ + type: command + short-summary: "Lists virtual network links to a DNS forwarding ruleset." + examples: + - name: List virtual network links to a DNS forwarding ruleset + text: |- + az dns-resolver vnet-link list --ruleset-name "sampleDnsForwardingRuleset" --resource-group \ +"sampleResourceGroup" +""" + +helps['dns-resolver vnet-link show'] = """ + type: command + short-summary: "Gets properties of a virtual network link to a DNS forwarding ruleset." + examples: + - name: Retrieve virtual network link to a DNS forwarding ruleset + text: |- + az dns-resolver vnet-link show --ruleset-name "sampleDnsForwardingRuleset" --resource-group \ +"sampleResourceGroup" --name "sampleVirtualNetworkLink" +""" + +helps['dns-resolver vnet-link create'] = """ + type: command + short-summary: "Create a virtual network link to a DNS forwarding ruleset." + examples: + - name: Upsert virtual network link to a DNS forwarding ruleset + text: |- + az dns-resolver vnet-link create --ruleset-name "sampleDnsForwardingRuleset" --metadata \ +additionalProp1="value1" --id "/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGro\ +upName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork" --resource-group "sampleResourceGroup" --name \ +"sampleVirtualNetworkLink" +""" + +helps['dns-resolver vnet-link update'] = """ + type: command + short-summary: "Updates a virtual network link to a DNS forwarding ruleset." + examples: + - name: Update virtual network link to a DNS forwarding ruleset + text: |- + az dns-resolver vnet-link update --ruleset-name "sampleDnsForwardingRuleset" --metadata \ +additionalProp1="value1" --resource-group "sampleResourceGroup" --name "sampleVirtualNetworkLink" +""" + +helps['dns-resolver vnet-link delete'] = """ + type: command + short-summary: "Deletes a virtual network link to a DNS forwarding ruleset. WARNING: This operation cannot be \ +undone." + examples: + - name: Delete virtual network link to a DNS forwarding ruleset + text: |- + az dns-resolver vnet-link delete --ruleset-name "sampleDnsForwardingRuleset" --resource-group \ +"sampleResourceGroup" --name "sampleVirtualNetworkLink" +""" + +helps['dns-resolver vnet-link wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the dns-resolver vnet-link is met. + examples: + - name: Pause executing next line of CLI script until the dns-resolver vnet-link is successfully created. + text: |- + az dns-resolver vnet-link wait --ruleset-name "sampleDnsForwardingRuleset" --resource-group \ +"sampleResourceGroup" --name "sampleVirtualNetworkLink" --created + - name: Pause executing next line of CLI script until the dns-resolver vnet-link is successfully updated. + text: |- + az dns-resolver vnet-link wait --ruleset-name "sampleDnsForwardingRuleset" --resource-group \ +"sampleResourceGroup" --name "sampleVirtualNetworkLink" --updated + - name: Pause executing next line of CLI script until the dns-resolver vnet-link is successfully deleted. + text: |- + az dns-resolver vnet-link wait --ruleset-name "sampleDnsForwardingRuleset" --resource-group \ +"sampleResourceGroup" --name "sampleVirtualNetworkLink" --deleted +""" diff --git a/src/dns-resolver/azext_dnsresolver/generated/_params.py b/src/dns-resolver/azext_dnsresolver/generated/_params.py new file mode 100644 index 00000000000..b5c0cea81e6 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/generated/_params.py @@ -0,0 +1,351 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group +from azext_dnsresolver.action import ( + AddIpConfigurations, + AddDnsResolverOutboundEndpoints, + AddDnsResolverForwardingRuleCreateTargetDnsServers, + AddDnsResolverForwardingRuleCreateMetadata, + AddDnsResolverForwardingRuleUpdateTargetDnsServers, + AddDnsResolverForwardingRuleUpdateMetadata, + AddDnsResolverVnetLinkCreateMetadata, + AddDnsResolverVnetLinkUpdateMetadata +) + + +def load_arguments(self, _): + + with self.argument_context('dns-resolver list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('virtual_network_name', type=str, help='The name of the virtual network.') + c.argument('top', type=int, help='The maximum number of results to return. If not specified, returns up to 100 ' + 'results.') + + with self.argument_context('dns-resolver show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', options_list=['--name', '-n', '--dns-resolver-name'], type=str, help='The name ' + 'of the DNS resolver.', id_part='name') + + with self.argument_context('dns-resolver create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', options_list=['--name', '-n', '--dns-resolver-name'], type=str, help='The name ' + 'of the DNS resolver.') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('if_none_match', type=str, help='Set to \'*\' to allow a new resource to be created, but to prevent ' + 'updating an existing resource. Other values will be ignored.') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('id_', options_list=['--id'], type=str, help='Resource ID.', arg_group='Virtual Network') + + with self.argument_context('dns-resolver update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', options_list=['--name', '-n', '--dns-resolver-name'], type=str, help='The name ' + 'of the DNS resolver.', id_part='name') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('tags', tags_type) + + with self.argument_context('dns-resolver delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', options_list=['--name', '-n', '--dns-resolver-name'], type=str, help='The name ' + 'of the DNS resolver.', id_part='name') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + + with self.argument_context('dns-resolver wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', options_list=['--name', '-n', '--dns-resolver-name'], type=str, help='The name ' + 'of the DNS resolver.', id_part='name') + + with self.argument_context('dns-resolver inbound-endpoint list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.') + c.argument('top', type=int, help='The maximum number of results to return. If not specified, returns up to 100 ' + 'results.') + + with self.argument_context('dns-resolver inbound-endpoint show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.', id_part='name') + c.argument('inbound_endpoint_name', options_list=['--name', '-n', '--inbound-endpoint-name'], type=str, + help='The name of the inbound endpoint for the DNS resolver.', id_part='child_name_1') + + with self.argument_context('dns-resolver inbound-endpoint create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.') + c.argument('inbound_endpoint_name', options_list=['--name', '-n', '--inbound-endpoint-name'], type=str, + help='The name of the inbound endpoint for the DNS resolver.') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('if_none_match', type=str, help='Set to \'*\' to allow a new resource to be created, but to prevent ' + 'updating an existing resource. Other values will be ignored.') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('ip_configurations', action=AddIpConfigurations, nargs='+', help='IP configurations for the inbound ' + 'endpoint.') + + with self.argument_context('dns-resolver inbound-endpoint update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.', id_part='name') + c.argument('inbound_endpoint_name', options_list=['--name', '-n', '--inbound-endpoint-name'], type=str, + help='The name of the inbound endpoint for the DNS resolver.', id_part='child_name_1') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('tags', tags_type) + + with self.argument_context('dns-resolver inbound-endpoint delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.', id_part='name') + c.argument('inbound_endpoint_name', options_list=['--name', '-n', '--inbound-endpoint-name'], type=str, + help='The name of the inbound endpoint for the DNS resolver.', id_part='child_name_1') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + + with self.argument_context('dns-resolver inbound-endpoint wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.', id_part='name') + c.argument('inbound_endpoint_name', options_list=['--name', '-n', '--inbound-endpoint-name'], type=str, + help='The name of the inbound endpoint for the DNS resolver.', id_part='child_name_1') + + with self.argument_context('dns-resolver outbound-endpoint list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.') + c.argument('top', type=int, help='The maximum number of results to return. If not specified, returns up to 100 ' + 'results.') + + with self.argument_context('dns-resolver outbound-endpoint show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.', id_part='name') + c.argument('outbound_endpoint_name', options_list=['--name', '-n', '--outbound-endpoint-name'], type=str, + help='The name of the outbound endpoint for the DNS resolver.', id_part='child_name_1') + + with self.argument_context('dns-resolver outbound-endpoint create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.') + c.argument('outbound_endpoint_name', options_list=['--name', '-n', '--outbound-endpoint-name'], type=str, + help='The name of the outbound endpoint for the DNS resolver.') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('if_none_match', type=str, help='Set to \'*\' to allow a new resource to be created, but to prevent ' + 'updating an existing resource. Other values will be ignored.') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('id_', options_list=['--id'], type=str, help='Resource ID.', arg_group='Subnet') + + with self.argument_context('dns-resolver outbound-endpoint update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.', id_part='name') + c.argument('outbound_endpoint_name', options_list=['--name', '-n', '--outbound-endpoint-name'], type=str, + help='The name of the outbound endpoint for the DNS resolver.', id_part='child_name_1') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('tags', tags_type) + + with self.argument_context('dns-resolver outbound-endpoint delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.', id_part='name') + c.argument('outbound_endpoint_name', options_list=['--name', '-n', '--outbound-endpoint-name'], type=str, + help='The name of the outbound endpoint for the DNS resolver.', id_part='child_name_1') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + + with self.argument_context('dns-resolver outbound-endpoint wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_resolver_name', type=str, help='The name of the DNS resolver.', id_part='name') + c.argument('outbound_endpoint_name', options_list=['--name', '-n', '--outbound-endpoint-name'], type=str, + help='The name of the outbound endpoint for the DNS resolver.', id_part='child_name_1') + + with self.argument_context('dns-resolver forwarding-ruleset list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('virtual_network_name', type=str, help='The name of the virtual network.') + c.argument('top', type=int, help='The maximum number of results to return. If not specified, returns up to 100 ' + 'results.') + + with self.argument_context('dns-resolver forwarding-ruleset show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--name', '-n', '--dns-forwarding-ruleset-name'], + type=str, help='The name of the DNS forwarding ruleset.', id_part='name') + + with self.argument_context('dns-resolver forwarding-ruleset create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--name', '-n', '--dns-forwarding-ruleset-name'], + type=str, help='The name of the DNS forwarding ruleset.') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('if_none_match', type=str, help='Set to \'*\' to allow a new resource to be created, but to prevent ' + 'updating an existing resource. Other values will be ignored.') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('dns_resolver_outbound_endpoints', options_list=['--outbound-endpoints'], + action=AddDnsResolverOutboundEndpoints, nargs='+', help='The reference to the DNS resolver outbound ' + 'endpoints that are used to route DNS queries matching the forwarding rules in the ruleset to the ' + 'target DNS servers.') + + with self.argument_context('dns-resolver forwarding-ruleset update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--name', '-n', '--dns-forwarding-ruleset-name'], + type=str, help='The name of the DNS forwarding ruleset.', id_part='name') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('tags', tags_type) + + with self.argument_context('dns-resolver forwarding-ruleset delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--name', '-n', '--dns-forwarding-ruleset-name'], + type=str, help='The name of the DNS forwarding ruleset.', id_part='name') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + + with self.argument_context('dns-resolver forwarding-ruleset wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--name', '-n', '--dns-forwarding-ruleset-name'], + type=str, help='The name of the DNS forwarding ruleset.', id_part='name') + + with self.argument_context('dns-resolver forwarding-rule list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--ruleset-name'], type=str, help='The name of the DNS ' + 'forwarding ruleset.') + c.argument('top', type=int, help='The maximum number of results to return. If not specified, returns up to 100 ' + 'results.') + + with self.argument_context('dns-resolver forwarding-rule show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--ruleset-name'], type=str, help='The name of the DNS ' + 'forwarding ruleset.', id_part='name') + c.argument('forwarding_rule_name', options_list=['--name', '-n', '--forwarding-rule-name'], type=str, + help='The name of the forwarding rule.', id_part='child_name_1') + + with self.argument_context('dns-resolver forwarding-rule create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--ruleset-name'], type=str, help='The name of the DNS ' + 'forwarding ruleset.') + c.argument('forwarding_rule_name', options_list=['--name', '-n', '--forwarding-rule-name'], type=str, + help='The name of the forwarding rule.') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('if_none_match', type=str, help='Set to \'*\' to allow a new resource to be created, but to prevent ' + 'updating an existing resource. Other values will be ignored.') + c.argument('domain_name', type=str, help='The domain name for the forwarding rule.') + c.argument('target_dns_servers', action=AddDnsResolverForwardingRuleCreateTargetDnsServers, nargs='+', + help='DNS servers to forward the DNS query to.') + c.argument('metadata', action=AddDnsResolverForwardingRuleCreateMetadata, nargs='+', help='Metadata attached ' + 'to the forwarding rule. Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('forwarding_rule_state', arg_type=get_enum_type(['Enabled', 'Disabled']), help='The state of ' + 'forwarding rule.') + + with self.argument_context('dns-resolver forwarding-rule update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--ruleset-name'], type=str, help='The name of the DNS ' + 'forwarding ruleset.', id_part='name') + c.argument('forwarding_rule_name', options_list=['--name', '-n', '--forwarding-rule-name'], type=str, + help='The name of the forwarding rule.', id_part='child_name_1') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('target_dns_servers', action=AddDnsResolverForwardingRuleUpdateTargetDnsServers, nargs='+', + help='DNS servers to forward the DNS query to.') + c.argument('metadata', action=AddDnsResolverForwardingRuleUpdateMetadata, nargs='+', help='Metadata attached ' + 'to the forwarding rule. Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('forwarding_rule_state', arg_type=get_enum_type(['Enabled', 'Disabled']), help='The state of ' + 'forwarding rule.') + + with self.argument_context('dns-resolver forwarding-rule delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--ruleset-name'], type=str, help='The name of the DNS ' + 'forwarding ruleset.', id_part='name') + c.argument('forwarding_rule_name', options_list=['--name', '-n', '--forwarding-rule-name'], type=str, + help='The name of the forwarding rule.', id_part='child_name_1') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + + with self.argument_context('dns-resolver vnet-link list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--ruleset-name'], type=str, help='The name of the DNS ' + 'forwarding ruleset.') + c.argument('top', type=int, help='The maximum number of results to return. If not specified, returns up to 100 ' + 'results.') + + with self.argument_context('dns-resolver vnet-link show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--ruleset-name'], type=str, help='The name of the DNS ' + 'forwarding ruleset.', id_part='name') + c.argument('virtual_network_link_name', options_list=['--name', '-n', '--virtual-network-link-name'], type=str, + help='The name of the virtual network link.', id_part='child_name_1') + + with self.argument_context('dns-resolver vnet-link create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--ruleset-name'], type=str, help='The name of the DNS ' + 'forwarding ruleset.') + c.argument('virtual_network_link_name', options_list=['--name', '-n', '--virtual-network-link-name'], type=str, + help='The name of the virtual network link.') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('if_none_match', type=str, help='Set to \'*\' to allow a new resource to be created, but to prevent ' + 'updating an existing resource. Other values will be ignored.') + c.argument('metadata', action=AddDnsResolverVnetLinkCreateMetadata, nargs='+', help='Metadata attached to the ' + 'virtual network link. Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('id_', options_list=['--id'], type=str, help='Resource ID.', arg_group='Virtual Network') + + with self.argument_context('dns-resolver vnet-link update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--ruleset-name'], type=str, help='The name of the DNS ' + 'forwarding ruleset.', id_part='name') + c.argument('virtual_network_link_name', options_list=['--name', '-n', '--virtual-network-link-name'], type=str, + help='The name of the virtual network link.', id_part='child_name_1') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + c.argument('metadata', action=AddDnsResolverVnetLinkUpdateMetadata, nargs='+', help='Metadata attached to the ' + 'virtual network link. Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + + with self.argument_context('dns-resolver vnet-link delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--ruleset-name'], type=str, help='The name of the DNS ' + 'forwarding ruleset.', id_part='name') + c.argument('virtual_network_link_name', options_list=['--name', '-n', '--virtual-network-link-name'], type=str, + help='The name of the virtual network link.', id_part='child_name_1') + c.argument('if_match', type=str, help='ETag of the resource. Omit this value to always overwrite the current ' + 'resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent ' + 'changes.') + + with self.argument_context('dns-resolver vnet-link wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('dns_forwarding_ruleset_name', options_list=['--ruleset-name'], type=str, help='The name of the DNS ' + 'forwarding ruleset.', id_part='name') + c.argument('virtual_network_link_name', options_list=['--name', '-n', '--virtual-network-link-name'], type=str, + help='The name of the virtual network link.', id_part='child_name_1') diff --git a/src/dns-resolver/azext_dnsresolver/generated/_validators.py b/src/dns-resolver/azext_dnsresolver/generated/_validators.py new file mode 100644 index 00000000000..b33a44c1ebf --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/generated/_validators.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- diff --git a/src/dns-resolver/azext_dnsresolver/generated/action.py b/src/dns-resolver/azext_dnsresolver/generated/action.py new file mode 100644 index 00000000000..c90e41c66af --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/generated/action.py @@ -0,0 +1,248 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +# pylint: disable=protected-access + +# pylint: disable=no-self-use + + +import argparse +from collections import defaultdict +from knack.util import CLIError + + +class AddIpConfigurations(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddIpConfigurations, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + + if kl == 'private-ip-address': + d['private_ip_address'] = v[0] + + elif kl == 'private-ip-allocation-method': + d['private_ip_allocation_method'] = v[0] + + elif kl == 'id': + sub_d = d + if 'subnet' not in sub_d: + sub_d['subnet'] = {} + sub_d = sub_d['subnet'] + + sub_d['id'] = v[0] + + else: + raise CLIError( + 'Unsupported Key {} is provided for parameter ip-configurations. All possible keys are:' + ' private-ip-address, private-ip-allocation-method, id'.format(k) + ) + + return d + + +class AddDnsResolverOutboundEndpoints(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddDnsResolverOutboundEndpoints, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + + if kl == 'id': + d['id'] = v[0] + + else: + raise CLIError( + 'Unsupported Key {} is provided for parameter dns-resolver-outbound-endpoints. All possible keys' + ' are: id'.format(k) + ) + + return d + + +class AddDnsResolverForwardingRuleUpdateTargetDnsServers(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddDnsResolverForwardingRuleUpdateTargetDnsServers, self).__call__( + parser, namespace, action, option_string + ) + + def get_action(self, values, option_string): + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + + if kl == 'ip-address': + d['ip_address'] = v[0] + + elif kl == 'port': + d['port'] = v[0] + + else: + raise CLIError( + 'Unsupported Key {} is provided for parameter target-dns-servers. All possible keys are:' + ' ip-address, port'.format(k) + ) + + return d + + +class AddDnsResolverForwardingRuleUpdateMetadata(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.metadata = action + + def get_action(self, values, option_string): + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + v = properties[k] + + d[k] = v[0] + + return d + + +class AddDnsResolverForwardingRuleCreateTargetDnsServers(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddDnsResolverForwardingRuleCreateTargetDnsServers, self).__call__( + parser, namespace, action, option_string + ) + + def get_action(self, values, option_string): + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + + if kl == 'ip-address': + d['ip_address'] = v[0] + + elif kl == 'port': + d['port'] = v[0] + + else: + raise CLIError( + 'Unsupported Key {} is provided for parameter target-dns-servers. All possible keys are:' + ' ip-address, port'.format(k) + ) + + return d + + +class AddDnsResolverForwardingRuleCreateMetadata(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.metadata = action + + def get_action(self, values, option_string): + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + v = properties[k] + + d[k] = v[0] + + return d + + +class AddDnsResolverVnetLinkUpdateMetadata(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.metadata = action + + def get_action(self, values, option_string): + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + v = properties[k] + + d[k] = v[0] + + return d + + +class AddDnsResolverVnetLinkCreateMetadata(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.metadata = action + + def get_action(self, values, option_string): + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + v = properties[k] + + d[k] = v[0] + + return d diff --git a/src/dns-resolver/azext_dnsresolver/generated/commands.py b/src/dns-resolver/azext_dnsresolver/generated/commands.py new file mode 100644 index 00000000000..225a69420d8 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/generated/commands.py @@ -0,0 +1,123 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals +# pylint: disable=bad-continuation +# pylint: disable=line-too-long + +from azure.cli.core.commands import CliCommandType +from azext_dnsresolver.generated._client_factory import ( + cf_dns_resolver, + cf_inbound_endpoint, + cf_outbound_endpoint, + cf_dns_forwarding_ruleset, + cf_forwarding_rule, + cf_virtual_network_link, +) + + +dns_resolver_dns_resolver = CliCommandType( + operations_tmpl=( + 'azext_dnsresolver.vendored_sdks.dnsresolver.operations._dns_resolvers_operations#DnsResolversOperations.{}' + ), + client_factory=cf_dns_resolver, +) + + +dns_resolver_forwarding_rule = CliCommandType( + operations_tmpl='azext_dnsresolver.vendored_sdks.dnsresolver.operations._forwarding_rules_operations#ForwardingRulesOperations.{}', + client_factory=cf_forwarding_rule, +) + + +dns_resolver_dns_forwarding_ruleset = CliCommandType( + operations_tmpl='azext_dnsresolver.vendored_sdks.dnsresolver.operations._dns_forwarding_rulesets_operations#DnsForwardingRulesetsOperations.{}', + client_factory=cf_dns_forwarding_ruleset, +) + + +dns_resolver_inbound_endpoint = CliCommandType( + operations_tmpl='azext_dnsresolver.vendored_sdks.dnsresolver.operations._inbound_endpoints_operations#InboundEndpointsOperations.{}', + client_factory=cf_inbound_endpoint, +) + + +dns_resolver_outbound_endpoint = CliCommandType( + operations_tmpl='azext_dnsresolver.vendored_sdks.dnsresolver.operations._outbound_endpoints_operations#OutboundEndpointsOperations.{}', + client_factory=cf_outbound_endpoint, +) + + +dns_resolver_virtual_network_link = CliCommandType( + operations_tmpl='azext_dnsresolver.vendored_sdks.dnsresolver.operations._virtual_network_links_operations#VirtualNetworkLinksOperations.{}', + client_factory=cf_virtual_network_link, +) + + +def load_command_table(self, _): + + with self.command_group( + 'dns-resolver', dns_resolver_dns_resolver, client_factory=cf_dns_resolver, is_preview=True + ) as g: + g.custom_command('list', 'dns_resolver_list') + g.custom_show_command('show', 'dns_resolver_show') + g.custom_command('create', 'dns_resolver_create', supports_no_wait=True) + g.custom_command('update', 'dns_resolver_update', supports_no_wait=True) + g.custom_command('delete', 'dns_resolver_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'dns_resolver_show') + + with self.command_group( + 'dns-resolver forwarding-rule', dns_resolver_forwarding_rule, client_factory=cf_forwarding_rule + ) as g: + g.custom_command('list', 'dns_resolver_forwarding_rule_list') + g.custom_show_command('show', 'dns_resolver_forwarding_rule_show') + g.custom_command('create', 'dns_resolver_forwarding_rule_create') + g.custom_command('update', 'dns_resolver_forwarding_rule_update') + g.custom_command('delete', 'dns_resolver_forwarding_rule_delete', confirmation=True) + + with self.command_group( + 'dns-resolver forwarding-ruleset', dns_resolver_dns_forwarding_ruleset, client_factory=cf_dns_forwarding_ruleset + ) as g: + g.custom_command('list', 'dns_resolver_forwarding_ruleset_list') + g.custom_show_command('show', 'dns_resolver_forwarding_ruleset_show') + g.custom_command('create', 'dns_resolver_forwarding_ruleset_create', supports_no_wait=True) + g.custom_command('update', 'dns_resolver_forwarding_ruleset_update', supports_no_wait=True) + g.custom_command('delete', 'dns_resolver_forwarding_ruleset_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'dns_resolver_forwarding_ruleset_show') + + with self.command_group( + 'dns-resolver inbound-endpoint', dns_resolver_inbound_endpoint, client_factory=cf_inbound_endpoint + ) as g: + g.custom_command('list', 'dns_resolver_inbound_endpoint_list') + g.custom_show_command('show', 'dns_resolver_inbound_endpoint_show') + g.custom_command('create', 'dns_resolver_inbound_endpoint_create', supports_no_wait=True) + g.custom_command('update', 'dns_resolver_inbound_endpoint_update', supports_no_wait=True) + g.custom_command('delete', 'dns_resolver_inbound_endpoint_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'dns_resolver_inbound_endpoint_show') + + with self.command_group( + 'dns-resolver outbound-endpoint', dns_resolver_outbound_endpoint, client_factory=cf_outbound_endpoint + ) as g: + g.custom_command('list', 'dns_resolver_outbound_endpoint_list') + g.custom_show_command('show', 'dns_resolver_outbound_endpoint_show') + g.custom_command('create', 'dns_resolver_outbound_endpoint_create', supports_no_wait=True) + g.custom_command('update', 'dns_resolver_outbound_endpoint_update', supports_no_wait=True) + g.custom_command('delete', 'dns_resolver_outbound_endpoint_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'dns_resolver_outbound_endpoint_show') + + with self.command_group( + 'dns-resolver vnet-link', dns_resolver_virtual_network_link, client_factory=cf_virtual_network_link + ) as g: + g.custom_command('list', 'dns_resolver_vnet_link_list') + g.custom_show_command('show', 'dns_resolver_vnet_link_show') + g.custom_command('create', 'dns_resolver_vnet_link_create', supports_no_wait=True) + g.custom_command('update', 'dns_resolver_vnet_link_update', supports_no_wait=True) + g.custom_command('delete', 'dns_resolver_vnet_link_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'dns_resolver_vnet_link_show') diff --git a/src/dns-resolver/azext_dnsresolver/generated/custom.py b/src/dns-resolver/azext_dnsresolver/generated/custom.py new file mode 100644 index 00000000000..892af2968ec --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/generated/custom.py @@ -0,0 +1,476 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from azure.cli.core.util import sdk_no_wait + + +def dns_resolver_list(client, + resource_group_name=None, + virtual_network_name=None, + top=None): + if resource_group_name and virtual_network_name is not None: + return client.list_by_virtual_network(resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + top=top) + elif resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name, + top=top) + return client.list(top=top) + + +def dns_resolver_show(client, + resource_group_name, + dns_resolver_name): + return client.get(resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name) + + +def dns_resolver_create(client, + resource_group_name, + dns_resolver_name, + location, + if_match=None, + if_none_match=None, + tags=None, + id_=None, + no_wait=False): + parameters = {} + if tags is not None: + parameters['tags'] = tags + parameters['location'] = location + parameters['virtual_network'] = {} + if id_ is not None: + parameters['virtual_network']['id'] = id_ + if len(parameters['virtual_network']) == 0: + del parameters['virtual_network'] + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + if_match=if_match, + if_none_match=if_none_match, + parameters=parameters) + + +def dns_resolver_update(client, + resource_group_name, + dns_resolver_name, + if_match=None, + tags=None, + no_wait=False): + parameters = {} + if tags is not None: + parameters['tags'] = tags + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + if_match=if_match, + parameters=parameters) + + +def dns_resolver_delete(client, + resource_group_name, + dns_resolver_name, + if_match=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + if_match=if_match) + + +def dns_resolver_inbound_endpoint_list(client, + resource_group_name, + dns_resolver_name, + top=None): + return client.list(resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + top=top) + + +def dns_resolver_inbound_endpoint_show(client, + resource_group_name, + dns_resolver_name, + inbound_endpoint_name): + return client.get(resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + inbound_endpoint_name=inbound_endpoint_name) + + +def dns_resolver_inbound_endpoint_create(client, + resource_group_name, + dns_resolver_name, + inbound_endpoint_name, + location, + if_match=None, + if_none_match=None, + tags=None, + ip_configurations=None, + no_wait=False): + parameters = {} + if tags is not None: + parameters['tags'] = tags + parameters['location'] = location + if ip_configurations is not None: + parameters['ip_configurations'] = ip_configurations + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + inbound_endpoint_name=inbound_endpoint_name, + if_match=if_match, + if_none_match=if_none_match, + parameters=parameters) + + +def dns_resolver_inbound_endpoint_update(client, + resource_group_name, + dns_resolver_name, + inbound_endpoint_name, + if_match=None, + tags=None, + no_wait=False): + parameters = {} + if tags is not None: + parameters['tags'] = tags + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + inbound_endpoint_name=inbound_endpoint_name, + if_match=if_match, + parameters=parameters) + + +def dns_resolver_inbound_endpoint_delete(client, + resource_group_name, + dns_resolver_name, + inbound_endpoint_name, + if_match=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + inbound_endpoint_name=inbound_endpoint_name, + if_match=if_match) + + +def dns_resolver_outbound_endpoint_list(client, + resource_group_name, + dns_resolver_name, + top=None): + return client.list(resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + top=top) + + +def dns_resolver_outbound_endpoint_show(client, + resource_group_name, + dns_resolver_name, + outbound_endpoint_name): + return client.get(resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + outbound_endpoint_name=outbound_endpoint_name) + + +def dns_resolver_outbound_endpoint_create(client, + resource_group_name, + dns_resolver_name, + outbound_endpoint_name, + location, + if_match=None, + if_none_match=None, + tags=None, + id_=None, + no_wait=False): + parameters = {} + if tags is not None: + parameters['tags'] = tags + parameters['location'] = location + parameters['subnet'] = {} + if id_ is not None: + parameters['subnet']['id'] = id_ + if len(parameters['subnet']) == 0: + del parameters['subnet'] + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + outbound_endpoint_name=outbound_endpoint_name, + if_match=if_match, + if_none_match=if_none_match, + parameters=parameters) + + +def dns_resolver_outbound_endpoint_update(client, + resource_group_name, + dns_resolver_name, + outbound_endpoint_name, + if_match=None, + tags=None, + no_wait=False): + parameters = {} + if tags is not None: + parameters['tags'] = tags + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + outbound_endpoint_name=outbound_endpoint_name, + if_match=if_match, + parameters=parameters) + + +def dns_resolver_outbound_endpoint_delete(client, + resource_group_name, + dns_resolver_name, + outbound_endpoint_name, + if_match=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + outbound_endpoint_name=outbound_endpoint_name, + if_match=if_match) + + +def dns_resolver_forwarding_ruleset_list(client, + resource_group_name=None, + virtual_network_name=None, + top=None): + if resource_group_name and virtual_network_name is not None: + return client.list_by_virtual_network(resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + top=top) + elif resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name, + top=top) + return client.list(top=top) + + +def dns_resolver_forwarding_ruleset_show(client, + resource_group_name, + dns_forwarding_ruleset_name): + return client.get(resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name) + + +def dns_resolver_forwarding_ruleset_create(client, + resource_group_name, + dns_forwarding_ruleset_name, + location, + if_match=None, + if_none_match=None, + tags=None, + dns_resolver_outbound_endpoints=None, + no_wait=False): + parameters = {} + if tags is not None: + parameters['tags'] = tags + parameters['location'] = location + if dns_resolver_outbound_endpoints is not None: + parameters['dns_resolver_outbound_endpoints'] = dns_resolver_outbound_endpoints + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + if_match=if_match, + if_none_match=if_none_match, + parameters=parameters) + + +def dns_resolver_forwarding_ruleset_update(client, + resource_group_name, + dns_forwarding_ruleset_name, + if_match=None, + tags=None, + no_wait=False): + parameters = {} + if tags is not None: + parameters['tags'] = tags + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + if_match=if_match, + parameters=parameters) + + +def dns_resolver_forwarding_ruleset_delete(client, + resource_group_name, + dns_forwarding_ruleset_name, + if_match=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + if_match=if_match) + + +def dns_resolver_forwarding_rule_list(client, + resource_group_name, + dns_forwarding_ruleset_name, + top=None): + return client.list(resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + top=top) + + +def dns_resolver_forwarding_rule_show(client, + resource_group_name, + dns_forwarding_ruleset_name, + forwarding_rule_name): + return client.get(resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + forwarding_rule_name=forwarding_rule_name) + + +def dns_resolver_forwarding_rule_create(client, + resource_group_name, + dns_forwarding_ruleset_name, + forwarding_rule_name, + if_match=None, + if_none_match=None, + domain_name=None, + target_dns_servers=None, + metadata=None, + forwarding_rule_state=None): + parameters = {} + if domain_name is not None: + parameters['domain_name'] = domain_name + if target_dns_servers is not None: + parameters['target_dns_servers'] = target_dns_servers + if metadata is not None: + parameters['metadata'] = metadata + if forwarding_rule_state is not None: + parameters['forwarding_rule_state'] = forwarding_rule_state + return client.create_or_update(resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + forwarding_rule_name=forwarding_rule_name, + if_match=if_match, + if_none_match=if_none_match, + parameters=parameters) + + +def dns_resolver_forwarding_rule_update(client, + resource_group_name, + dns_forwarding_ruleset_name, + forwarding_rule_name, + if_match=None, + target_dns_servers=None, + metadata=None, + forwarding_rule_state=None): + parameters = {} + if target_dns_servers is not None: + parameters['target_dns_servers'] = target_dns_servers + if metadata is not None: + parameters['metadata'] = metadata + if forwarding_rule_state is not None: + parameters['forwarding_rule_state'] = forwarding_rule_state + return client.update(resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + forwarding_rule_name=forwarding_rule_name, + if_match=if_match, + parameters=parameters) + + +def dns_resolver_forwarding_rule_delete(client, + resource_group_name, + dns_forwarding_ruleset_name, + forwarding_rule_name, + if_match=None): + return client.delete(resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + forwarding_rule_name=forwarding_rule_name, + if_match=if_match) + + +def dns_resolver_vnet_link_list(client, + resource_group_name, + dns_forwarding_ruleset_name, + top=None): + return client.list(resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + top=top) + + +def dns_resolver_vnet_link_show(client, + resource_group_name, + dns_forwarding_ruleset_name, + virtual_network_link_name): + return client.get(resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + virtual_network_link_name=virtual_network_link_name) + + +def dns_resolver_vnet_link_create(client, + resource_group_name, + dns_forwarding_ruleset_name, + virtual_network_link_name, + if_match=None, + if_none_match=None, + metadata=None, + id_=None, + no_wait=False): + parameters = {} + if metadata is not None: + parameters['metadata'] = metadata + parameters['virtual_network'] = {} + if id_ is not None: + parameters['virtual_network']['id'] = id_ + if len(parameters['virtual_network']) == 0: + del parameters['virtual_network'] + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + virtual_network_link_name=virtual_network_link_name, + if_match=if_match, + if_none_match=if_none_match, + parameters=parameters) + + +def dns_resolver_vnet_link_update(client, + resource_group_name, + dns_forwarding_ruleset_name, + virtual_network_link_name, + if_match=None, + metadata=None, + no_wait=False): + parameters = {} + if metadata is not None: + parameters['metadata'] = metadata + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + virtual_network_link_name=virtual_network_link_name, + if_match=if_match, + parameters=parameters) + + +def dns_resolver_vnet_link_delete(client, + resource_group_name, + dns_forwarding_ruleset_name, + virtual_network_link_name, + if_match=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + virtual_network_link_name=virtual_network_link_name, + if_match=if_match) diff --git a/src/dns-resolver/azext_dnsresolver/manual/__init__.py b/src/dns-resolver/azext_dnsresolver/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/manual/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/dns-resolver/azext_dnsresolver/manual/_help.py b/src/dns-resolver/azext_dnsresolver/manual/_help.py new file mode 100644 index 00000000000..eeff5abae98 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/manual/_help.py @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + +helps['dns-resolver inbound-endpoint create'] = """ + type: command + short-summary: "Create an inbound endpoint for a DNS resolver." + parameters: + - name: --ip-configurations + short-summary: "IP configurations for the inbound endpoint." + long-summary: | + Usage: --ip-configurations private-ip-address=XX private-ip-allocation-method=XX id=XX + + private-ip-address: Private IP address of the IP configuration. + private-ip-allocation-method: Private IP address allocation method. + id: Resource ID. + + Multiple actions can be specified by using more than one --ip-configurations argument. + examples: + - name: Upsert inbound endpoint for DNS resolver + text: |- + az dns-resolver inbound-endpoint create --dns-resolver-name "sampleDnsResolver" --name \ +"sampleInboundEndpoint" --location "westus2" --ip-configurations private-ip-address="" \ +private-ip-allocation-method="Dynamic" id="/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnet\ +ResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet" --tags \ +key1="value1" --resource-group "sampleResourceGroup" +""" diff --git a/src/dns-resolver/azext_dnsresolver/tests/__init__.py b/src/dns-resolver/azext_dnsresolver/tests/__init__.py new file mode 100644 index 00000000000..70488e93851 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/tests/__init__.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +import inspect +import logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func).lower() + module_path = __path__[0].lower() + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") + if use_exception_cache is None or use_exception_cache.lower() != "true": + raise + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/dns-resolver/azext_dnsresolver/tests/latest/__init__.py b/src/dns-resolver/azext_dnsresolver/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_crud.yaml b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_crud.yaml new file mode 100644 index 00000000000..7012db75512 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_crud.yaml @@ -0,0 +1,878 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T10:09:50Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:09:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {}, "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "dhcpOptions": {}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + Content-Length: + - '123' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003\",\r\n + \ \"etag\": \"W/\\\"528d0003-61dc-4a08-8264-34b648efe516\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"9493d711-6ee5-4bab-b978-06bf19dbb490\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/3c1f5bf2-31ef-4bc8-9316-0b0a4926ab09?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '697' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:09:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - f34e83f4-0f82-423a-b1c1-356e5aa2e561 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/3c1f5bf2-31ef-4bc8-9316-0b0a4926ab09?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:10: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-arm-service-request-id: + - 329d57d3-b646-4bb2-bda0-4f9b16f3486b + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003\",\r\n + \ \"etag\": \"W/\\\"3dbcc447-9c01-434b-abd7-1ba742c4b2be\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"9493d711-6ee5-4bab-b978-06bf19dbb490\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:10:01 GMT + etag: + - W/"3dbcc447-9c01-434b-abd7-1ba742c4b2be" + 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: + - b95ddccb-213d-4de2-8e2f-d0aa79b263ca + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003\",\r\n + \ \"etag\": \"W/\\\"3dbcc447-9c01-434b-abd7-1ba742c4b2be\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"9493d711-6ee5-4bab-b978-06bf19dbb490\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:10:03 GMT + etag: + - W/"3dbcc447-9c01-434b-abd7-1ba742c4b2be" + 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: + - 8403452c-6ea3-4857-95e4-c3cb5778682e + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T10:09:50Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:10:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"tags": {"key": "value1"}, "location": "eastus", "properties": {"virtualNetwork": + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + Content-Length: + - '246' + Content-Type: + - application/json + ParameterSetName: + - -n -g --id --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000002?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjEzNTIwNDZkLWMzNjktNDUyYy1iMGZmLTA0M2EyOWE3Njg0NSJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:10:11 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjEzNTIwNDZkLWMzNjktNDUyYy1iMGZmLTA0M2EyOWE3Njg0NSJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 299799ad-e124-418f-a36c-332e4e9fc75c + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjEzNTIwNDZkLWMzNjktNDUyYy1iMGZmLTA0M2EyOWE3Njg0NSJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjEzNTIwNDZkLWMzNjktNDUyYy1iMGZmLTA0M2EyOWE3Njg0NSJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjEzNTIwNDZkLWMzNjktNDUyYy1iMGZmLTA0M2EyOWE3Njg0NSJ9","startTime":"2022-04-12T10:10:11.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '494' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:10:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 8219d6c9-e966-42bf-ab2c-b828b674f73e + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjEzNTIwNDZkLWMzNjktNDUyYy1iMGZmLTA0M2EyOWE3Njg0NSJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjEzNTIwNDZkLWMzNjktNDUyYy1iMGZmLTA0M2EyOWE3Njg0NSJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjEzNTIwNDZkLWMzNjktNDUyYy1iMGZmLTA0M2EyOWE3Njg0NSJ9","startTime":"2022-04-12T10:10:11.0000000Z","endTime":"2022-04-12T10:10:22.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '534' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:10:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 00ae42ee-8d85-4925-b909-d2d17a5cf1bd + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003"},"dnsResolverState":"Connected","provisioningState":"Succeeded","resourceGuid":"abf425b1-e968-44a5-a8f1-bb4994f99218"},"etag":"\"19057d8b-0000-0100-0000-6255500e0000\"","location":"eastus","tags":{"key":"value1"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000002","name":"dns-resolver-000002","type":"Microsoft.Network/dnsResolvers","systemData":{"createdAt":"2022-04-12T10:10:10.2408396Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:10:10.2408396Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '795' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:10:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 489f0494-1bd7-4616-a751-febfcbce1b86 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers?api-version=2020-04-01-preview + response: + body: + string: '{"value":[{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003"},"dnsResolverState":"Connected","provisioningState":"Succeeded","resourceGuid":"abf425b1-e968-44a5-a8f1-bb4994f99218"},"etag":"\"19057d8b-0000-0100-0000-6255500e0000\"","location":"eastus","tags":{"key":"value1"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000002","name":"dns-resolver-000002","type":"Microsoft.Network/dnsResolvers","systemData":{"createdAt":"2022-04-12T10:10:10.2408396Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:10:10.2408396Z","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '807' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:10:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - d8b2bd7c-1c57-4ca4-89fc-cb328d02574d + x-ms-ratelimit-remaining-subscription-resource-entities-read: + - '59999' + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: '{"tags": {"key": "value2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver update + Connection: + - keep-alive + Content-Length: + - '27' + Content-Type: + - application/json + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000002?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdjZTFmYzY4LTRkZDEtNGI4My1hOWQ4LTY0NzJhNWM4N2QwZSJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:10:51 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdjZTFmYzY4LTRkZDEtNGI4My1hOWQ4LTY0NzJhNWM4N2QwZSJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 72b4605c-c7d1-4c4e-962f-eaa044bea3aa + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdjZTFmYzY4LTRkZDEtNGI4My1hOWQ4LTY0NzJhNWM4N2QwZSJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdjZTFmYzY4LTRkZDEtNGI4My1hOWQ4LTY0NzJhNWM4N2QwZSJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdjZTFmYzY4LTRkZDEtNGI4My1hOWQ4LTY0NzJhNWM4N2QwZSJ9","startTime":"2022-04-12T10:10:52.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '494' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:10:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 5fb4d562-667a-4b7f-85d7-d577c36aafa9 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdjZTFmYzY4LTRkZDEtNGI4My1hOWQ4LTY0NzJhNWM4N2QwZSJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdjZTFmYzY4LTRkZDEtNGI4My1hOWQ4LTY0NzJhNWM4N2QwZSJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdjZTFmYzY4LTRkZDEtNGI4My1hOWQ4LTY0NzJhNWM4N2QwZSJ9","startTime":"2022-04-12T10:10:52.0000000Z","endTime":"2022-04-12T10:11:00.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '534' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:11:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - b9244c97-504e-497e-bfb1-239cf3343206 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003"},"dnsResolverState":"Connected","provisioningState":"Succeeded","resourceGuid":"abf425b1-e968-44a5-a8f1-bb4994f99218"},"etag":"\"19059998-0000-0100-0000-625550330000\"","location":"eastus","tags":{"key":"value2"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000002","name":"dns-resolver-000002","type":"Microsoft.Network/dnsResolvers","systemData":{"createdAt":"2022-04-12T10:10:10.2408396Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:10:51.3072798Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '795' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:11:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 17bfd81a-643a-4c7a-a2c4-caf3b318450f + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003"},"dnsResolverState":"Connected","provisioningState":"Succeeded","resourceGuid":"abf425b1-e968-44a5-a8f1-bb4994f99218"},"etag":"\"19059998-0000-0100-0000-625550330000\"","location":"eastus","tags":{"key":"value2"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000002","name":"dns-resolver-000002","type":"Microsoft.Network/dnsResolvers","systemData":{"createdAt":"2022-04-12T10:10:10.2408396Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:10:51.3072798Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '795' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:11:29 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 0fbe2299-5226-4721-ada9-e347793c3142 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g --no-wait --yes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000002?api-version=2020-04-01-preview + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiRGVsZXRlRG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjFhZmJkMTE2LThjN2YtNDc1ZC1iMWQ5LWVmOWNjYWMyMzU3NCJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 12 Apr 2022 10:11:31 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiRGVsZXRlRG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjFhZmJkMTE2LThjN2YtNDc1ZC1iMWQ5LWVmOWNjYWMyMzU3NCJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - df364a5a-dd77-4267-8ad1-3fbb1ca60ebc + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +version: 1 diff --git a/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_inbound_crud.yaml b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_inbound_crud.yaml new file mode 100644 index 00000000000..93ff135c41e --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_inbound_crud.yaml @@ -0,0 +1,1491 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T09:59:30Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:34 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {}, "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "dhcpOptions": {}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + Content-Length: + - '123' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"c0b23eae-3a7a-4020-b40c-b523d433ffd4\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"012dbe9a-ae92-4f62-8917-790592c46643\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/d8d29bd8-3236-4a42-9834-5f9a4deb866e?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '697' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 6d9da632-10a1-4b1d-80aa-a8712a51e04b + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/d8d29bd8-3236-4a42-9834-5f9a4deb866e?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:44 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-arm-service-request-id: + - 0b2f5cf8-a3c4-43df-9ab5-7adb066bae56 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"542fdefb-57d8-49b1-9274-277db67304ea\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"012dbe9a-ae92-4f62-8917-790592c46643\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:44 GMT + etag: + - W/"542fdefb-57d8-49b1-9274-277db67304ea" + 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: + - c89b8bc4-95b3-47fc-856b-846befe91dfe + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"542fdefb-57d8-49b1-9274-277db67304ea\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"012dbe9a-ae92-4f62-8917-790592c46643\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:45 GMT + etag: + - W/"542fdefb-57d8-49b1-9274-277db67304ea" + 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: + - 652da55c-02c3-4bfb-a3e5-e63b93537beb + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004", + "location": "eastus", "tags": {}, "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "dhcpOptions": {"dnsServers": []}, "subnets": [{"name": "subnet-000005", + "properties": {"addressPrefix": "10.0.0.0/24", "privateEndpointNetworkPolicies": + "Enabled", "privateLinkServiceNetworkPolicies": "Enabled"}}], "virtualNetworkPeerings": + [], "enableDdosProtection": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + Content-Length: + - '542' + Content-Type: + - application/json + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"59a39655-22a2-47ff-991e-c24eade283ed\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"012dbe9a-ae92-4f62-8917-790592c46643\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000005\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005\",\r\n + \ \"etag\": \"W/\\\"59a39655-22a2-47ff-991e-c24eade283ed\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/29099c1b-430c-4a25-ab88-875a80725352?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '1339' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:47 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-arm-service-request-id: + - 0289ff4b-3bcf-48ec-b3bc-8ea0e58e4430 + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/29099c1b-430c-4a25-ab88-875a80725352?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:50 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-arm-service-request-id: + - 5019685d-a1c5-4636-be21-a69b1c60a0d6 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"b6f1f42b-e009-4d5a-81af-d30d14f2ffe5\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"012dbe9a-ae92-4f62-8917-790592c46643\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000005\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005\",\r\n + \ \"etag\": \"W/\\\"b6f1f42b-e009-4d5a-81af-d30d14f2ffe5\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1341' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:51 GMT + etag: + - W/"b6f1f42b-e009-4d5a-81af-d30d14f2ffe5" + 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: + - 97d1c6e5-c98b-428f-beb5-861a6d1e678b + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"b6f1f42b-e009-4d5a-81af-d30d14f2ffe5\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"012dbe9a-ae92-4f62-8917-790592c46643\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000005\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005\",\r\n + \ \"etag\": \"W/\\\"b6f1f42b-e009-4d5a-81af-d30d14f2ffe5\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1341' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:52 GMT + etag: + - W/"b6f1f42b-e009-4d5a-81af-d30d14f2ffe5" + 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: + - 5586b192-3702-477f-b93d-96aac50f1197 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet show + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"subnet-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005\",\r\n + \ \"etag\": \"W/\\\"b6f1f42b-e009-4d5a-81af-d30d14f2ffe5\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '557' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:54 GMT + etag: + - W/"b6f1f42b-e009-4d5a-81af-d30d14f2ffe5" + 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: + - a4ef0023-607a-4d25-b61f-8d6e625807c9 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T09:59:30Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"virtualNetwork": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + Content-Length: + - '219' + Content-Type: + - application/json + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImRlMDNhMmE1LTIxM2ItNDdmYi1iNDk2LTc2NjhjOWVhMTQ4MiJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:59 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImRlMDNhMmE1LTIxM2ItNDdmYi1iNDk2LTc2NjhjOWVhMTQ4MiJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 65fba7f2-6136-4d61-8fc6-1142b18f7b16 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImRlMDNhMmE1LTIxM2ItNDdmYi1iNDk2LTc2NjhjOWVhMTQ4MiJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImRlMDNhMmE1LTIxM2ItNDdmYi1iNDk2LTc2NjhjOWVhMTQ4MiJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImRlMDNhMmE1LTIxM2ItNDdmYi1iNDk2LTc2NjhjOWVhMTQ4MiJ9","startTime":"2022-04-12T10:00:00.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '494' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - d48d0ab1-01ac-4e64-a197-8234d4e33455 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImRlMDNhMmE1LTIxM2ItNDdmYi1iNDk2LTc2NjhjOWVhMTQ4MiJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImRlMDNhMmE1LTIxM2ItNDdmYi1iNDk2LTc2NjhjOWVhMTQ4MiJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImRlMDNhMmE1LTIxM2ItNDdmYi1iNDk2LTc2NjhjOWVhMTQ4MiJ9","startTime":"2022-04-12T10:00:00.0000000Z","endTime":"2022-04-12T10:00:12.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '534' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 67496234-7ac5-4d4b-b24e-630f45f2f5f2 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004"},"dnsResolverState":"Connected","provisioningState":"Succeeded","resourceGuid":"4a5ab62d-da53-4083-b0e6-0685cf063de4"},"etag":"\"18050adb-0000-0100-0000-62554dab0000\"","location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003","name":"dns-resolver-000003","type":"Microsoft.Network/dnsResolvers","systemData":{"createdAt":"2022-04-12T09:59:59.5885026Z","createdByType":"User","lastModifiedAt":"2022-04-12T09:59:59.5885026Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '771' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - c4ac0a3b-009c-4560-8560-dd49e3e4027f + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --ip-configurations --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T09:59:30Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:37 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: '{"tags": {"key": "value1"}, "location": "eastus", "properties": {"ipConfigurations": + [{"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005"}, + "privateIpAddress": "", "privateIpAllocationMethod": "Dynamic"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint create + Connection: + - keep-alive + Content-Length: + - '348' + Content-Type: + - application/json + ParameterSetName: + - -n -g --dns-resolver-name --ip-configurations --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/inboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:45 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - c490c598-9744-45a5-aa01-eedd6566d53a + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --ip-configurations --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==","startTime":"2022-04-12T10:00:44.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 9efdf989-1539-4ec3-b70f-1b7126be2ad0 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --ip-configurations --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==","startTime":"2022-04-12T10:00:44.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 92967322-34d4-4be2-b558-0bd8934f48b4 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --ip-configurations --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==","startTime":"2022-04-12T10:00:44.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - d7b28f4f-7097-4a7f-a06c-6bad4fefac90 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '497' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --ip-configurations --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJjYmUzMWZiYy1hMGY0LTQxYmItODM5Ny1kMTU0MjA3NGMxNGEifQ==","startTime":"2022-04-12T10:00:44.0000000Z","endTime":"2022-04-12T10:01:52.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '550' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 78f8d147-fc7b-4fbd-ae97-a56f32886790 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '496' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --ip-configurations --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/inboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"ipConfigurations":[{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005"},"privateIpAddress":"10.0.0.4","privateIpAllocationMethod":"Dynamic"}],"provisioningState":"Succeeded","resourceGuid":"4861eec2-6943-439a-9e7c-76d59b799d3e"},"etag":"\"6001c8e3-0000-0100-0000-62554e0f0000\"","location":"eastus","tags":{"key":"value1"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/inboundEndpoints/endpoint-000002","name":"endpoint-000002","type":"Microsoft.Network/dnsResolvers/inboundEndpoints","systemData":{"createdAt":"2022-04-12T10:00:44.0667368Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:00:44.0667368Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '915' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 15b9b7c9-669a-428c-8a5e-37cc7f81a248 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint list + Connection: + - keep-alive + ParameterSetName: + - -g --dns-resolver-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/inboundEndpoints?api-version=2020-04-01-preview + response: + body: + string: '{"value":[{"properties":{"ipConfigurations":[{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005"},"privateIpAddress":"10.0.0.4","privateIpAllocationMethod":"Dynamic"}],"provisioningState":"Succeeded","resourceGuid":"4861eec2-6943-439a-9e7c-76d59b799d3e"},"etag":"\"6001c8e3-0000-0100-0000-62554e0f0000\"","location":"eastus","tags":{"key":"value1"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/inboundEndpoints/endpoint-000002","name":"endpoint-000002","type":"Microsoft.Network/dnsResolvers/inboundEndpoints","systemData":{"createdAt":"2022-04-12T10:00:44.0667368Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:00:44.0667368Z","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '927' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - a4f63041-f2c4-4852-8f74-7d1a40db96e9 + x-ms-ratelimit-remaining-subscription-resource-entities-read: + - '59999' + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: '{"tags": {"key": "value2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint update + Connection: + - keep-alive + Content-Length: + - '27' + Content-Type: + - application/json + ParameterSetName: + - -n -g --dns-resolver-name --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/inboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiI4M2JkMTNjZC0wNjhmLTRiYzItYTE5YS1kMWVjYTk2YzE3MmUifQ==?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:26 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiI4M2JkMTNjZC0wNjhmLTRiYzItYTE5YS1kMWVjYTk2YzE3MmUifQ==?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - c122a824-a237-400d-a05b-a69c52bf661f + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint update + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiI4M2JkMTNjZC0wNjhmLTRiYzItYTE5YS1kMWVjYTk2YzE3MmUifQ==?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiI4M2JkMTNjZC0wNjhmLTRiYzItYTE5YS1kMWVjYTk2YzE3MmUifQ==","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0SW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiI4M2JkMTNjZC0wNjhmLTRiYzItYTE5YS1kMWVjYTk2YzE3MmUifQ==","startTime":"2022-04-12T10:02:27.0000000Z","endTime":"2022-04-12T10:02:29.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '550' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 88a501fc-fad7-4b38-8fcf-39c9587a4f65 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint update + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/inboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"ipConfigurations":[{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005"},"privateIpAddress":"10.0.0.4","privateIpAllocationMethod":"Dynamic"}],"provisioningState":"Succeeded","resourceGuid":"4861eec2-6943-439a-9e7c-76d59b799d3e"},"etag":"\"600197e4-0000-0100-0000-62554e340000\"","location":"eastus","tags":{"key":"value2"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/inboundEndpoints/endpoint-000002","name":"endpoint-000002","type":"Microsoft.Network/dnsResolvers/inboundEndpoints","systemData":{"createdAt":"2022-04-12T10:00:44.0667368Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:02:25.7218895Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '915' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 659aeb1b-ece0-411e-b679-1c7f952ebc16 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint show + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/inboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"ipConfigurations":[{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005"},"privateIpAddress":"10.0.0.4","privateIpAllocationMethod":"Dynamic"}],"provisioningState":"Succeeded","resourceGuid":"4861eec2-6943-439a-9e7c-76d59b799d3e"},"etag":"\"600197e4-0000-0100-0000-62554e340000\"","location":"eastus","tags":{"key":"value2"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/inboundEndpoints/endpoint-000002","name":"endpoint-000002","type":"Microsoft.Network/dnsResolvers/inboundEndpoints","systemData":{"createdAt":"2022-04-12T10:00:44.0667368Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:02:25.7218895Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '915' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 99926cd0-4600-4c26-acbf-8840d989d9ea + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver inbound-endpoint delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g --dns-resolver-name --no-wait --yes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/inboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiRGVsZXRlSW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJhMzMyYmIxMy0wOTMxLTQ1OWItYmU4MC03NzEzYjJlOTQ0MzcifQ==?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 12 Apr 2022 10:02:36 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiRGVsZXRlSW5ib3VuZEVuZHBvaW50IiwiT3BlcmF0aW9uSWQiOiJhMzMyYmIxMy0wOTMxLTQ1OWItYmU4MC03NzEzYjJlOTQ0MzcifQ==?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 38f60ebe-ef7d-47e2-82c3-ad94df1b9259 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +version: 1 diff --git a/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_outbound_crud.yaml b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_outbound_crud.yaml new file mode 100644 index 00000000000..362a3ff5efc --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_outbound_crud.yaml @@ -0,0 +1,1438 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T09:59:30Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {}, "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "dhcpOptions": {}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + Content-Length: + - '123' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"54de8fcd-4b4a-4aa1-98bf-e26bcb2689e1\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"d6a19e73-bffb-4744-8752-052285798299\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/fdc05fbd-7b2a-4fb3-a16d-ac430f803a01?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '697' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 4818c92e-4bf1-40b9-9d8f-f0e7d48ddc0a + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/fdc05fbd-7b2a-4fb3-a16d-ac430f803a01?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:45 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-arm-service-request-id: + - 1d2377f6-3172-4165-9384-d59cb17734b5 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"a62daf72-b4e9-42c5-b580-d50b6b3638a2\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"d6a19e73-bffb-4744-8752-052285798299\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:45 GMT + etag: + - W/"a62daf72-b4e9-42c5-b580-d50b6b3638a2" + 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: + - 0a76915f-25bc-421a-b745-f604f89bf5af + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"a62daf72-b4e9-42c5-b580-d50b6b3638a2\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"d6a19e73-bffb-4744-8752-052285798299\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:46 GMT + etag: + - W/"a62daf72-b4e9-42c5-b580-d50b6b3638a2" + 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: + - f9a9fbe9-1727-452d-9f4c-c64c8c90e6ca + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004", + "location": "eastus", "tags": {}, "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "dhcpOptions": {"dnsServers": []}, "subnets": [{"name": "subnet-000005", + "properties": {"addressPrefix": "10.0.0.0/24", "privateEndpointNetworkPolicies": + "Enabled", "privateLinkServiceNetworkPolicies": "Enabled"}}], "virtualNetworkPeerings": + [], "enableDdosProtection": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + Content-Length: + - '542' + Content-Type: + - application/json + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"5d9902be-fded-4a61-bd58-16a5abc7c50d\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"d6a19e73-bffb-4744-8752-052285798299\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000005\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005\",\r\n + \ \"etag\": \"W/\\\"5d9902be-fded-4a61-bd58-16a5abc7c50d\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/3ce99b7b-b6d3-45e5-bd50-6eeb8d2ecc64?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '1339' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:47 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-arm-service-request-id: + - c9109700-4a92-43f0-8f21-afb2a2d72c16 + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/3ce99b7b-b6d3-45e5-bd50-6eeb8d2ecc64?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:51 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-arm-service-request-id: + - 1e29ed83-6102-43ad-9ff0-218babd316d1 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"37c5c369-0883-43ff-a660-8cf2cca32f92\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"d6a19e73-bffb-4744-8752-052285798299\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000005\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005\",\r\n + \ \"etag\": \"W/\\\"37c5c369-0883-43ff-a660-8cf2cca32f92\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1341' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:52 GMT + etag: + - W/"37c5c369-0883-43ff-a660-8cf2cca32f92" + 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: + - 3b4c3f19-f80e-4ba0-b973-e5ef0df5fc70 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004\",\r\n + \ \"etag\": \"W/\\\"37c5c369-0883-43ff-a660-8cf2cca32f92\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"d6a19e73-bffb-4744-8752-052285798299\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000005\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005\",\r\n + \ \"etag\": \"W/\\\"37c5c369-0883-43ff-a660-8cf2cca32f92\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1341' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:53 GMT + etag: + - W/"37c5c369-0883-43ff-a660-8cf2cca32f92" + 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: + - 2785c9db-d96f-4ecb-b575-22a2e5bcdbca + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet show + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"subnet-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005\",\r\n + \ \"etag\": \"W/\\\"37c5c369-0883-43ff-a660-8cf2cca32f92\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '557' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:55 GMT + etag: + - W/"37c5c369-0883-43ff-a660-8cf2cca32f92" + 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: + - 08efc07d-8bd5-446d-91d5-547bc8609ffe + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T09:59:30Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"virtualNetwork": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + Content-Length: + - '219' + Content-Type: + - application/json + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdiOThjMjU2LTY5OTYtNDM5My1hZWNlLTFiM2MyNTJhNTQyNyJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:03 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdiOThjMjU2LTY5OTYtNDM5My1hZWNlLTFiM2MyNTJhNTQyNyJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - e6cb7d1d-94b0-449a-95e9-514a05d51085 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdiOThjMjU2LTY5OTYtNDM5My1hZWNlLTFiM2MyNTJhNTQyNyJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdiOThjMjU2LTY5OTYtNDM5My1hZWNlLTFiM2MyNTJhNTQyNyJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdiOThjMjU2LTY5OTYtNDM5My1hZWNlLTFiM2MyNTJhNTQyNyJ9","startTime":"2022-04-12T10:00:03.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '494' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 20cb56af-309e-4f10-9abc-ebb6b3bf1584 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdiOThjMjU2LTY5OTYtNDM5My1hZWNlLTFiM2MyNTJhNTQyNyJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdiOThjMjU2LTY5OTYtNDM5My1hZWNlLTFiM2MyNTJhNTQyNyJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjdiOThjMjU2LTY5OTYtNDM5My1hZWNlLTFiM2MyNTJhNTQyNyJ9","startTime":"2022-04-12T10:00:03.0000000Z","endTime":"2022-04-12T10:00:11.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '534' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 3308eba9-3da0-49cc-9989-2277ab510468 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004"},"dnsResolverState":"Connected","provisioningState":"Succeeded","resourceGuid":"6e4aa15f-7d36-4921-b935-f6451144ff71"},"etag":"\"1805cada-0000-0100-0000-62554daa0000\"","location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003","name":"dns-resolver-000003","type":"Microsoft.Network/dnsResolvers","systemData":{"createdAt":"2022-04-12T10:00:02.8363904Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:00:02.8363904Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '771' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 418e78f8-adf9-4908-90e2-7b2271ad8316 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T09:59:30Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"tags": {"key": "value1"}, "location": "eastus", "properties": {"subnet": + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + Content-Length: + - '260' + Content-Type: + - application/json + ParameterSetName: + - -n -g --dns-resolver-name --id --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/outboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiMTkyZWUyMmQtMDNhMC00OTQ2LTg2Y2ItY2I2ZjJmMzAxZjEwIn0=?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:46 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiMTkyZWUyMmQtMDNhMC00OTQ2LTg2Y2ItY2I2ZjJmMzAxZjEwIn0=?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - f6ede863-7462-4dce-9be7-4ade47067f4a + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiMTkyZWUyMmQtMDNhMC00OTQ2LTg2Y2ItY2I2ZjJmMzAxZjEwIn0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiMTkyZWUyMmQtMDNhMC00OTQ2LTg2Y2ItY2I2ZjJmMzAxZjEwIn0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiMTkyZWUyMmQtMDNhMC00OTQ2LTg2Y2ItY2I2ZjJmMzAxZjEwIn0=","startTime":"2022-04-12T10:00:46.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 5e8cb492-ddd7-4b3d-9f5d-0bac30cd95fc + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiMTkyZWUyMmQtMDNhMC00OTQ2LTg2Y2ItY2I2ZjJmMzAxZjEwIn0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiMTkyZWUyMmQtMDNhMC00OTQ2LTg2Y2ItY2I2ZjJmMzAxZjEwIn0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiMTkyZWUyMmQtMDNhMC00OTQ2LTg2Y2ItY2I2ZjJmMzAxZjEwIn0=","startTime":"2022-04-12T10:00:46.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - d9458c92-cc01-4395-9579-0c512d684176 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiMTkyZWUyMmQtMDNhMC00OTQ2LTg2Y2ItY2I2ZjJmMzAxZjEwIn0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiMTkyZWUyMmQtMDNhMC00OTQ2LTg2Y2ItY2I2ZjJmMzAxZjEwIn0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiMTkyZWUyMmQtMDNhMC00OTQ2LTg2Y2ItY2I2ZjJmMzAxZjEwIn0=","startTime":"2022-04-12T10:00:46.0000000Z","endTime":"2022-04-12T10:01:42.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '550' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - fa8380ed-2a8a-487f-a85f-79b7aa048cc9 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '497' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/outboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005"},"provisioningState":"Succeeded","resourceGuid":"4ccf1bcc-afbf-4818-aa8e-5456f7a82488"},"etag":"\"60018fe3-0000-0100-0000-62554e050000\"","location":"eastus","tags":{"key":"value1"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/outboundEndpoints/endpoint-000002","name":"endpoint-000002","type":"Microsoft.Network/dnsResolvers/outboundEndpoints","systemData":{"createdAt":"2022-04-12T10:00:45.2412484Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:00:45.2412484Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '826' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 64dca8e4-b279-4356-ae19-c8e368e6820d + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint list + Connection: + - keep-alive + ParameterSetName: + - -g --dns-resolver-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/outboundEndpoints?api-version=2020-04-01-preview + response: + body: + string: '{"value":[{"properties":{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005"},"provisioningState":"Succeeded","resourceGuid":"4ccf1bcc-afbf-4818-aa8e-5456f7a82488"},"etag":"\"60018fe3-0000-0100-0000-62554e050000\"","location":"eastus","tags":{"key":"value1"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/outboundEndpoints/endpoint-000002","name":"endpoint-000002","type":"Microsoft.Network/dnsResolvers/outboundEndpoints","systemData":{"createdAt":"2022-04-12T10:00:45.2412484Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:00:45.2412484Z","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '838' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - b6973b7a-0153-46ff-b784-24426d058741 + x-ms-ratelimit-remaining-subscription-resource-entities-read: + - '59999' + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: '{"tags": {"key": "value2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint update + Connection: + - keep-alive + Content-Length: + - '27' + Content-Type: + - application/json + ParameterSetName: + - -n -g --dns-resolver-name --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/outboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZjFhODIyMDktNjM1Ni00OTYzLTgzYzYtZmI4ODVlYmVmZWYzIn0=?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:56 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZjFhODIyMDktNjM1Ni00OTYzLTgzYzYtZmI4ODVlYmVmZWYzIn0=?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 14cdc385-06ca-4bd3-a4a6-cf140cf7415c + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint update + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZjFhODIyMDktNjM1Ni00OTYzLTgzYzYtZmI4ODVlYmVmZWYzIn0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZjFhODIyMDktNjM1Ni00OTYzLTgzYzYtZmI4ODVlYmVmZWYzIn0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZjFhODIyMDktNjM1Ni00OTYzLTgzYzYtZmI4ODVlYmVmZWYzIn0=","startTime":"2022-04-12T10:01:57.0000000Z","endTime":"2022-04-12T10:01:59.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '550' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 54841191-6c29-48a2-97a9-9581b0c527f6 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint update + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/outboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005"},"provisioningState":"Succeeded","resourceGuid":"4ccf1bcc-afbf-4818-aa8e-5456f7a82488"},"etag":"\"6001e3e3-0000-0100-0000-62554e160000\"","location":"eastus","tags":{"key":"value2"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/outboundEndpoints/endpoint-000002","name":"endpoint-000002","type":"Microsoft.Network/dnsResolvers/outboundEndpoints","systemData":{"createdAt":"2022-04-12T10:00:45.2412484Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:01:56.5346673Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '826' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 1a063d24-e476-42e1-bdc8-16da2031b65f + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint show + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/outboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000004/subnets/subnet-000005"},"provisioningState":"Succeeded","resourceGuid":"4ccf1bcc-afbf-4818-aa8e-5456f7a82488"},"etag":"\"6001e3e3-0000-0100-0000-62554e160000\"","location":"eastus","tags":{"key":"value2"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/outboundEndpoints/endpoint-000002","name":"endpoint-000002","type":"Microsoft.Network/dnsResolvers/outboundEndpoints","systemData":{"createdAt":"2022-04-12T10:00:45.2412484Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:01:56.5346673Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '826' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 58c9861b-67af-43d9-ab4c-b1b1c5195aba + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g --dns-resolver-name --no-wait --yes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000003/outboundEndpoints/endpoint-000002?api-version=2020-04-01-preview + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiRGVsZXRlT3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZDQ3ZWQxYjAtZDI4Yi00OTAyLWJiYzktMTc5YmU1ZGY4ODJmIn0=?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 12 Apr 2022 10:02:06 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiRGVsZXRlT3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZDQ3ZWQxYjAtZDI4Yi00OTAyLWJiYzktMTc5YmU1ZGY4ODJmIn0=?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 31d7157e-79e9-485a-b94e-61e6387437c9 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +version: 1 diff --git a/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_rule_crud.yaml b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_rule_crud.yaml new file mode 100644 index 00000000000..61033a2d370 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_rule_crud.yaml @@ -0,0 +1,1635 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T09:59:30Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:34 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {}, "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "dhcpOptions": {}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + Content-Length: + - '123' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"0c6ebe79-e262-4ea6-aac2-a8991da2c04c\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"fc3b62ae-5bd4-492a-be7d-d9d1b6f9e5e4\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e71b7262-378b-4a63-a30c-dd58a1abbcfa?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '697' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:39 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 24bbe0c3-bcc9-404f-a13d-aeb0e137bf92 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e71b7262-378b-4a63-a30c-dd58a1abbcfa?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:43 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-arm-service-request-id: + - 9b28395b-8d77-4478-8dc7-4414ddd31786 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"f2970fb7-e5a5-42bb-ac16-fc232277c4b8\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"fc3b62ae-5bd4-492a-be7d-d9d1b6f9e5e4\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:44 GMT + etag: + - W/"f2970fb7-e5a5-42bb-ac16-fc232277c4b8" + 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: + - 1b7a34dc-4e11-42f3-9407-48127fca4c0b + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"f2970fb7-e5a5-42bb-ac16-fc232277c4b8\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"fc3b62ae-5bd4-492a-be7d-d9d1b6f9e5e4\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:45 GMT + etag: + - W/"f2970fb7-e5a5-42bb-ac16-fc232277c4b8" + 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: + - 2bc02967-37a1-48c5-a979-81e3dd71f122 + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006", + "location": "eastus", "tags": {}, "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "dhcpOptions": {"dnsServers": []}, "subnets": [{"name": "subnet-000007", + "properties": {"addressPrefix": "10.0.0.0/24", "privateEndpointNetworkPolicies": + "Enabled", "privateLinkServiceNetworkPolicies": "Enabled"}}], "virtualNetworkPeerings": + [], "enableDdosProtection": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + Content-Length: + - '542' + Content-Type: + - application/json + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"cb0805ef-acc9-4984-b833-9d017217e393\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"fc3b62ae-5bd4-492a-be7d-d9d1b6f9e5e4\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000007\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007\",\r\n + \ \"etag\": \"W/\\\"cb0805ef-acc9-4984-b833-9d017217e393\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/7b0a132f-ba09-4d06-8a5f-ff1debe40585?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '1339' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:47 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-arm-service-request-id: + - 8852b6d3-5aef-4839-b72f-6c6efdba5e19 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/7b0a132f-ba09-4d06-8a5f-ff1debe40585?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:50 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-arm-service-request-id: + - 29f07f89-a494-48ce-8568-46ec8fe2f479 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"d261619d-13df-4002-a018-23f3e761ef3e\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"fc3b62ae-5bd4-492a-be7d-d9d1b6f9e5e4\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000007\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007\",\r\n + \ \"etag\": \"W/\\\"d261619d-13df-4002-a018-23f3e761ef3e\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1341' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:50 GMT + etag: + - W/"d261619d-13df-4002-a018-23f3e761ef3e" + 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: + - ce9b504f-07db-4de9-ae8e-09bbc9fc0678 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"d261619d-13df-4002-a018-23f3e761ef3e\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"fc3b62ae-5bd4-492a-be7d-d9d1b6f9e5e4\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000007\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007\",\r\n + \ \"etag\": \"W/\\\"d261619d-13df-4002-a018-23f3e761ef3e\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1341' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:51 GMT + etag: + - W/"d261619d-13df-4002-a018-23f3e761ef3e" + 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: + - 953cbc86-cac0-424d-8e3d-6778722ba5af + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet show + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"subnet-000007\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007\",\r\n + \ \"etag\": \"W/\\\"d261619d-13df-4002-a018-23f3e761ef3e\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '557' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59:52 GMT + etag: + - W/"d261619d-13df-4002-a018-23f3e761ef3e" + 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: + - fe2abf28-3d5f-4f2a-a468-527758d06d3b + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T09:59:30Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 09:59: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": "eastus", "properties": {"virtualNetwork": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + Content-Length: + - '219' + Content-Type: + - application/json + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6Ijg5ZGNjNjdhLWUwZTYtNDljYi04ZmYyLWUyYTUzOGNlODY3MyJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:00 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6Ijg5ZGNjNjdhLWUwZTYtNDljYi04ZmYyLWUyYTUzOGNlODY3MyJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - a78df53d-5394-45df-90c1-c0b1093bc65c + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6Ijg5ZGNjNjdhLWUwZTYtNDljYi04ZmYyLWUyYTUzOGNlODY3MyJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6Ijg5ZGNjNjdhLWUwZTYtNDljYi04ZmYyLWUyYTUzOGNlODY3MyJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6Ijg5ZGNjNjdhLWUwZTYtNDljYi04ZmYyLWUyYTUzOGNlODY3MyJ9","startTime":"2022-04-12T10:00:01.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '494' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 055f282d-2095-4e9e-8831-7cb8d972f61c + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6Ijg5ZGNjNjdhLWUwZTYtNDljYi04ZmYyLWUyYTUzOGNlODY3MyJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6Ijg5ZGNjNjdhLWUwZTYtNDljYi04ZmYyLWUyYTUzOGNlODY3MyJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6Ijg5ZGNjNjdhLWUwZTYtNDljYi04ZmYyLWUyYTUzOGNlODY3MyJ9","startTime":"2022-04-12T10:00:01.0000000Z","endTime":"2022-04-12T10:00:12.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '534' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 6dc8e5d4-ca56-4a58-b809-d9de37f870f4 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006"},"dnsResolverState":"Connected","provisioningState":"Succeeded","resourceGuid":"bad00ef4-a674-4464-ab52-cc2324ab415e"},"etag":"\"180502db-0000-0100-0000-62554dab0000\"","location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005","name":"dns-resolver-000005","type":"Microsoft.Network/dnsResolvers","systemData":{"createdAt":"2022-04-12T10:00:00.317118Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:00:00.317118Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '769' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - e20b7870-46b0-4729-8825-eb0d4c248ac1 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T09:59:30Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:37 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": "eastus", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + Content-Length: + - '233' + Content-Type: + - application/json + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005/outboundEndpoints/endpoint-000004?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiOWNlZWYyN2YtZDI1OS00YjQwLWI4NTctZTVjMTg5OWQxYzUwIn0=?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:45 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiOWNlZWYyN2YtZDI1OS00YjQwLWI4NTctZTVjMTg5OWQxYzUwIn0=?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 8efa8e5f-d257-420a-bbcf-8eb02edf947d + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiOWNlZWYyN2YtZDI1OS00YjQwLWI4NTctZTVjMTg5OWQxYzUwIn0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiOWNlZWYyN2YtZDI1OS00YjQwLWI4NTctZTVjMTg5OWQxYzUwIn0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiOWNlZWYyN2YtZDI1OS00YjQwLWI4NTctZTVjMTg5OWQxYzUwIn0=","startTime":"2022-04-12T10:00:46.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 0a93d93a-bfde-41f9-ac09-b812a9f08c1e + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiOWNlZWYyN2YtZDI1OS00YjQwLWI4NTctZTVjMTg5OWQxYzUwIn0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiOWNlZWYyN2YtZDI1OS00YjQwLWI4NTctZTVjMTg5OWQxYzUwIn0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiOWNlZWYyN2YtZDI1OS00YjQwLWI4NTctZTVjMTg5OWQxYzUwIn0=","startTime":"2022-04-12T10:00:46.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 64aadf8b-034d-4bfe-af1a-d4ceb79bc719 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiOWNlZWYyN2YtZDI1OS00YjQwLWI4NTctZTVjMTg5OWQxYzUwIn0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiOWNlZWYyN2YtZDI1OS00YjQwLWI4NTctZTVjMTg5OWQxYzUwIn0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiOWNlZWYyN2YtZDI1OS00YjQwLWI4NTctZTVjMTg5OWQxYzUwIn0=","startTime":"2022-04-12T10:00:46.0000000Z","endTime":"2022-04-12T10:01:42.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '550' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 60bebe2c-d225-4243-99a6-1164efd59195 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '497' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005/outboundEndpoints/endpoint-000004?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007"},"provisioningState":"Succeeded","resourceGuid":"61dc9361-74ca-4e3b-a4f9-048b6463cc84"},"etag":"\"600191e3-0000-0100-0000-62554e050000\"","location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005/outboundEndpoints/endpoint-000004","name":"endpoint-000004","type":"Microsoft.Network/dnsResolvers/outboundEndpoints","systemData":{"createdAt":"2022-04-12T10:00:44.4096676Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:00:44.4096676Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '802' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - acbeeb4c-c1a2-48e3-bac7-798b1cd075f5 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T09:59:30Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01: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": "eastus", "properties": {"dnsResolverOutboundEndpoints": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005/outboundEndpoints/endpoint-000004"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + Content-Length: + - '274' + Content-Type: + - application/json + ParameterSetName: + - -n -g --outbound-endpoints + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjEyZGY4NmJkLTAyMTYtNDg2ZC1iMTI3LTVlZjQ2NWNlODFjMSJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:58 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjEyZGY4NmJkLTAyMTYtNDg2ZC1iMTI3LTVlZjQ2NWNlODFjMSJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - f78e2aae-c091-4004-a3d7-60b576808ff4 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjEyZGY4NmJkLTAyMTYtNDg2ZC1iMTI3LTVlZjQ2NWNlODFjMSJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjEyZGY4NmJkLTAyMTYtNDg2ZC1iMTI3LTVlZjQ2NWNlODFjMSJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjEyZGY4NmJkLTAyMTYtNDg2ZC1iMTI3LTVlZjQ2NWNlODFjMSJ9","startTime":"2022-04-12T10:01:58.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '518' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 35342698-b46d-4e8b-acd7-d691f1577400 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjEyZGY4NmJkLTAyMTYtNDg2ZC1iMTI3LTVlZjQ2NWNlODFjMSJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjEyZGY4NmJkLTAyMTYtNDg2ZC1iMTI3LTVlZjQ2NWNlODFjMSJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjEyZGY4NmJkLTAyMTYtNDg2ZC1iMTI3LTVlZjQ2NWNlODFjMSJ9","startTime":"2022-04-12T10:01:58.0000000Z","endTime":"2022-04-12T10:02:10.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '558' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 13d8f79d-98b7-4d74-ab78-44606717c9ae + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"dnsResolverOutboundEndpoints":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005/outboundEndpoints/endpoint-000004"}],"provisioningState":"Succeeded","resourceGuid":"f4b5a7e8-938b-4ee8-9d99-89e9a25602d0"},"etag":"\"ab028402-0000-0100-0000-62554e210000\"","location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003","name":"ruleset-000003","type":"Microsoft.Network/dnsForwardingRulesets","systemData":{"createdAt":"2022-04-12T10:01:58.0140711Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:01:58.0140711Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '803' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 2bca241e-7b61-4854-aed3-c87945d755a6 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"domainName": "contoso.com.", "targetDnsServers": [{"ipAddress": + "10.0.0.1", "port": 53}], "metadata": {"additionalProp": "value1"}, "forwardingRuleState": + "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-rule create + Connection: + - keep-alive + Content-Length: + - '183' + Content-Type: + - application/json + ParameterSetName: + - -n -g --ruleset-name --domain-name --forwarding-rule-state --metadata --target-dns-servers + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/forwardingRules/rule-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"domainName":"contoso.com.","targetDnsServers":[{"ipAddress":"10.0.0.1","port":53}],"metadata":{"additionalProp":"value1"},"forwardingRuleState":"Enabled","provisioningState":"Succeeded"},"etag":"\"6a039ef2-0000-0100-0000-62554e3c0000\"","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/forwardingRules/rule-000002","name":"rule-000002","type":"Microsoft.Network/dnsForwardingRulesets/forwardingRules","systemData":{"createdAt":"2022-04-12T10:02:35.7580348Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:02:35.7580348Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '692' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 1c3a930c-c74a-44cf-90bd-cf4469bde3d9 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-rule list + Connection: + - keep-alive + ParameterSetName: + - -g --ruleset-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/forwardingRules?api-version=2020-04-01-preview + response: + body: + string: '{"value":[{"properties":{"domainName":"contoso.com.","targetDnsServers":[{"ipAddress":"10.0.0.1","port":53}],"metadata":{"additionalProp":"value1"},"forwardingRuleState":"Enabled","provisioningState":"Succeeded"},"etag":"\"6a039ef2-0000-0100-0000-62554e3c0000\"","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/forwardingRules/rule-000002","name":"rule-000002","type":"Microsoft.Network/dnsForwardingRulesets/forwardingRules","systemData":{"createdAt":"2022-04-12T10:02:35.7580348Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:02:35.7580348Z","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '704' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - c4c19b9f-b077-4aa2-b214-4a62fc4ce0c9 + x-ms-ratelimit-remaining-subscription-resource-entities-read: + - '59999' + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"metadata": {"additionalProp": "value2"}, "forwardingRuleState": + "Disabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-rule update + Connection: + - keep-alive + Content-Length: + - '93' + Content-Type: + - application/json + ParameterSetName: + - -n -g --ruleset-name --forwarding-rule-state --metadata + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/forwardingRules/rule-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"domainName":"contoso.com.","targetDnsServers":[{"ipAddress":"10.0.0.1","port":53}],"metadata":{"additionalProp":"value2"},"forwardingRuleState":"Disabled","provisioningState":"Succeeded"},"etag":"\"6a03d8f2-0000-0100-0000-62554e400000\"","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/forwardingRules/rule-000002","name":"rule-000002","type":"Microsoft.Network/dnsForwardingRulesets/forwardingRules","systemData":{"createdAt":"2022-04-12T10:02:35.7580348Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:02:39.0393595Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '693' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:39 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - f1b28e05-87e2-400a-beb1-4dd3ca3ec355 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-rule show + Connection: + - keep-alive + ParameterSetName: + - -n -g --ruleset-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/forwardingRules/rule-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"domainName":"contoso.com.","targetDnsServers":[{"ipAddress":"10.0.0.1","port":53}],"metadata":{"additionalProp":"value2"},"forwardingRuleState":"Disabled","provisioningState":"Succeeded"},"etag":"\"6a03d8f2-0000-0100-0000-62554e400000\"","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/forwardingRules/rule-000002","name":"rule-000002","type":"Microsoft.Network/dnsForwardingRulesets/forwardingRules","systemData":{"createdAt":"2022-04-12T10:02:35.7580348Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:02:39.0393595Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '693' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - a34ad61d-289f-4883-8bd7-fb0ae7f21152 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-rule delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g --ruleset-name --yes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/forwardingRules/rule-000002?api-version=2020-04-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 12 Apr 2022 10:02:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - a92a177e-a578-4d68-b2ae-67fa5fd2129b + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_ruleset_crud.yaml b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_ruleset_crud.yaml new file mode 100644 index 00000000000..c446baacf26 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_ruleset_crud.yaml @@ -0,0 +1,1786 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T10:00:35Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:37 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": "eastus", "tags": {}, "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "dhcpOptions": {}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + Content-Length: + - '123' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005\",\r\n + \ \"etag\": \"W/\\\"be209d26-3259-4db8-8962-365b877889d3\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"de1dc793-4e57-4384-8eda-5eb86e66ac3d\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e932e792-f0c4-4419-88f4-73979384a791?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '697' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - a34745ff-19f6-46df-91da-6c1e58c8ac14 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e932e792-f0c4-4419-88f4-73979384a791?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:49 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-arm-service-request-id: + - f57bdf35-a31b-4ce3-ab0c-7052bc49c6ff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005\",\r\n + \ \"etag\": \"W/\\\"135962d9-8bdf-4e87-a3cc-2735e0b13569\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"de1dc793-4e57-4384-8eda-5eb86e66ac3d\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:49 GMT + etag: + - W/"135962d9-8bdf-4e87-a3cc-2735e0b13569" + 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: + - 3a990f81-1363-4fb6-9a0e-7f125cd90569 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005\",\r\n + \ \"etag\": \"W/\\\"135962d9-8bdf-4e87-a3cc-2735e0b13569\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"de1dc793-4e57-4384-8eda-5eb86e66ac3d\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:51 GMT + etag: + - W/"135962d9-8bdf-4e87-a3cc-2735e0b13569" + 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: + - f018bfbd-9721-4726-8237-471ee40ef8bf + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005", + "location": "eastus", "tags": {}, "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "dhcpOptions": {"dnsServers": []}, "subnets": [{"name": "subnet-000006", + "properties": {"addressPrefix": "10.0.0.0/24", "privateEndpointNetworkPolicies": + "Enabled", "privateLinkServiceNetworkPolicies": "Enabled"}}], "virtualNetworkPeerings": + [], "enableDdosProtection": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + Content-Length: + - '542' + Content-Type: + - application/json + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005\",\r\n + \ \"etag\": \"W/\\\"29ba510f-dc79-46e5-94ac-62b3795babdf\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"de1dc793-4e57-4384-8eda-5eb86e66ac3d\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000006\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005/subnets/subnet-000006\",\r\n + \ \"etag\": \"W/\\\"29ba510f-dc79-46e5-94ac-62b3795babdf\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/91d71b18-6210-47a7-b38b-0f27052f45a3?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '1339' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:52 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-arm-service-request-id: + - 3fb8937a-c7de-48e4-9e51-0ff22a96beb4 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/91d71b18-6210-47a7-b38b-0f27052f45a3?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:56 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-arm-service-request-id: + - 2fbba1bb-ab7a-4667-8ae1-4d3f200be1b2 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005\",\r\n + \ \"etag\": \"W/\\\"af190048-9ab8-4e3c-80ee-38a95b146e45\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"de1dc793-4e57-4384-8eda-5eb86e66ac3d\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000006\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005/subnets/subnet-000006\",\r\n + \ \"etag\": \"W/\\\"af190048-9ab8-4e3c-80ee-38a95b146e45\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1341' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:56 GMT + etag: + - W/"af190048-9ab8-4e3c-80ee-38a95b146e45" + 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: + - fe4d2007-be61-4209-9af9-7c6fb623db5b + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005\",\r\n + \ \"etag\": \"W/\\\"af190048-9ab8-4e3c-80ee-38a95b146e45\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"de1dc793-4e57-4384-8eda-5eb86e66ac3d\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000006\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005/subnets/subnet-000006\",\r\n + \ \"etag\": \"W/\\\"af190048-9ab8-4e3c-80ee-38a95b146e45\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1341' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:56 GMT + etag: + - W/"af190048-9ab8-4e3c-80ee-38a95b146e45" + 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: + - f9048014-8c82-4312-a87a-16cac2984cd2 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet show + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005/subnets/subnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"subnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005/subnets/subnet-000006\",\r\n + \ \"etag\": \"W/\\\"af190048-9ab8-4e3c-80ee-38a95b146e45\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '557' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00:59 GMT + etag: + - W/"af190048-9ab8-4e3c-80ee-38a95b146e45" + 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: + - b864cb5e-3148-4b67-b5fc-a661c7b1ea85 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T10:00:35Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:00: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: '{"location": "eastus", "properties": {"virtualNetwork": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + Content-Length: + - '219' + Content-Type: + - application/json + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000004?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjRjNTQwY2Y0LTQwNmMtNDU4Yy1iYzNhLTk4MjRkOWVlNzI4MSJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:03 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjRjNTQwY2Y0LTQwNmMtNDU4Yy1iYzNhLTk4MjRkOWVlNzI4MSJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - f0c92493-9cb2-4df7-a096-aba30ebcb0e4 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjRjNTQwY2Y0LTQwNmMtNDU4Yy1iYzNhLTk4MjRkOWVlNzI4MSJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjRjNTQwY2Y0LTQwNmMtNDU4Yy1iYzNhLTk4MjRkOWVlNzI4MSJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjRjNTQwY2Y0LTQwNmMtNDU4Yy1iYzNhLTk4MjRkOWVlNzI4MSJ9","startTime":"2022-04-12T10:01:03.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '494' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 8be32e4b-4dfe-4eb7-bcbc-050f2ae6112f + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjRjNTQwY2Y0LTQwNmMtNDU4Yy1iYzNhLTk4MjRkOWVlNzI4MSJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjRjNTQwY2Y0LTQwNmMtNDU4Yy1iYzNhLTk4MjRkOWVlNzI4MSJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6IjRjNTQwY2Y0LTQwNmMtNDU4Yy1iYzNhLTk4MjRkOWVlNzI4MSJ9","startTime":"2022-04-12T10:01:03.0000000Z","endTime":"2022-04-12T10:01:12.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '534' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - ffb809ff-0ebf-417a-831d-34dd9afc8d16 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000004?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005"},"dnsResolverState":"Connected","provisioningState":"Succeeded","resourceGuid":"a93084d2-73ef-4297-a529-b614804695b9"},"etag":"\"180583ea-0000-0100-0000-62554de70000\"","location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000004","name":"dns-resolver-000004","type":"Microsoft.Network/dnsResolvers","systemData":{"createdAt":"2022-04-12T10:01:02.8596909Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:01:02.8596909Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '771' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:39 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 1a808434-6b21-4985-b115-a455752255ef + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T10:00:35Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:40 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": "eastus", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005/subnets/subnet-000006"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + Content-Length: + - '233' + Content-Type: + - application/json + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000004/outboundEndpoints/endpoint-000003?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:46 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 2bf0d422-f7bb-47cd-8f68-91ae88e94faa + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=","startTime":"2022-04-12T10:01:47.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:01:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 4ea49740-3aa3-47c7-8100-cad793d8b0a6 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=","startTime":"2022-04-12T10:01:47.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 435c4da3-8dc0-434a-849b-58bed100ee19 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=","startTime":"2022-04-12T10:01:47.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 22291ed8-0ad0-4cc3-b889-dfb923f022d9 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '497' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZGFiOWEwYjItMjJlOC00ODc4LTllYjAtOWVhOGIwNGZiYmI1In0=","startTime":"2022-04-12T10:01:47.0000000Z","endTime":"2022-04-12T10:02:57.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '550' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 783b1376-2206-4d74-a38a-6ef6e32bc180 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '496' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000004/outboundEndpoints/endpoint-000003?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000005/subnets/subnet-000006"},"provisioningState":"Succeeded","resourceGuid":"5fffbfe3-5ae1-4e54-8346-5c5ee78bc81b"},"etag":"\"6001fbe4-0000-0100-0000-62554e4f0000\"","location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000004/outboundEndpoints/endpoint-000003","name":"endpoint-000003","type":"Microsoft.Network/dnsResolvers/outboundEndpoints","systemData":{"createdAt":"2022-04-12T10:01:46.397112Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:01:46.397112Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - e551469e-3b36-4e6f-b5e5-293e9a27fce4 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T10:00:35Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:25 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: '{"tags": {"key": "value1"}, "location": "eastus", "properties": {"dnsResolverOutboundEndpoints": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000004/outboundEndpoints/endpoint-000003"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + Content-Length: + - '301' + Content-Type: + - application/json + ParameterSetName: + - -n -g --outbound-endpoints --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000002?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImI1MTU2NjA1LTY2ZjktNDYxOC04OWRkLTE5OTVkYmIyMWY3NyJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:29 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImI1MTU2NjA1LTY2ZjktNDYxOC04OWRkLTE5OTVkYmIyMWY3NyJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - fff2863f-45ed-4af8-89b8-4dd7484fcd2a + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImI1MTU2NjA1LTY2ZjktNDYxOC04OWRkLTE5OTVkYmIyMWY3NyJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImI1MTU2NjA1LTY2ZjktNDYxOC04OWRkLTE5OTVkYmIyMWY3NyJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImI1MTU2NjA1LTY2ZjktNDYxOC04OWRkLTE5OTVkYmIyMWY3NyJ9","startTime":"2022-04-12T10:03:29.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '518' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 192f73ba-4e82-44bc-bdea-7485230aacab + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImI1MTU2NjA1LTY2ZjktNDYxOC04OWRkLTE5OTVkYmIyMWY3NyJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImI1MTU2NjA1LTY2ZjktNDYxOC04OWRkLTE5OTVkYmIyMWY3NyJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImI1MTU2NjA1LTY2ZjktNDYxOC04OWRkLTE5OTVkYmIyMWY3NyJ9","startTime":"2022-04-12T10:03:29.0000000Z","endTime":"2022-04-12T10:03:40.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '558' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:04:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 1d4a0530-a9ef-4a80-815c-d99ee47ad7e3 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"dnsResolverOutboundEndpoints":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000004/outboundEndpoints/endpoint-000003"}],"provisioningState":"Succeeded","resourceGuid":"2f7aee71-ef53-4329-ae0b-b3e5b17a3801"},"etag":"\"ab02b707-0000-0100-0000-62554e7b0000\"","location":"eastus","tags":{"key":"value1"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000002","name":"ruleset-000002","type":"Microsoft.Network/dnsForwardingRulesets","systemData":{"createdAt":"2022-04-12T10:03:28.8013639Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:03:28.8013639Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '827' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:04:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 78c475ba-295c-44c4-afa4-0e8bebe21916 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets?api-version=2020-04-01-preview + response: + body: + string: '{"value":[{"properties":{"dnsResolverOutboundEndpoints":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000004/outboundEndpoints/endpoint-000003"}],"provisioningState":"Succeeded","resourceGuid":"2f7aee71-ef53-4329-ae0b-b3e5b17a3801"},"etag":"\"ab02b707-0000-0100-0000-62554e7b0000\"","location":"eastus","tags":{"key":"value1"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000002","name":"ruleset-000002","type":"Microsoft.Network/dnsForwardingRulesets","systemData":{"createdAt":"2022-04-12T10:03:28.8013639Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:03:28.8013639Z","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '839' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:04:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 6ac0aa3f-746f-45d0-afc3-bdc21b3d57a7 + x-ms-ratelimit-remaining-subscription-resource-entities-read: + - '59999' + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: '{"tags": {"key": "value2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset update + Connection: + - keep-alive + Content-Length: + - '27' + Content-Type: + - application/json + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000002?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImU5ZTA3Yjk1LTJmNGYtNDUzOC05NmY2LTE1OGUyNDM3ZjMwNyJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:04:10 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImU5ZTA3Yjk1LTJmNGYtNDUzOC05NmY2LTE1OGUyNDM3ZjMwNyJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 58c9062f-edce-4862-954c-e21fdbd12080 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImU5ZTA3Yjk1LTJmNGYtNDUzOC05NmY2LTE1OGUyNDM3ZjMwNyJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImU5ZTA3Yjk1LTJmNGYtNDUzOC05NmY2LTE1OGUyNDM3ZjMwNyJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImU5ZTA3Yjk1LTJmNGYtNDUzOC05NmY2LTE1OGUyNDM3ZjMwNyJ9","startTime":"2022-04-12T10:04:10.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '518' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:04:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 596f688c-8738-4cf5-ba01-824e2b3a008f + x-ms-ratelimit-remaining-subscription-resource-requests: + - '497' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImU5ZTA3Yjk1LTJmNGYtNDUzOC05NmY2LTE1OGUyNDM3ZjMwNyJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImU5ZTA3Yjk1LTJmNGYtNDUzOC05NmY2LTE1OGUyNDM3ZjMwNyJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6ImU5ZTA3Yjk1LTJmNGYtNDUzOC05NmY2LTE1OGUyNDM3ZjMwNyJ9","startTime":"2022-04-12T10:04:10.0000000Z","endTime":"2022-04-12T10:04:20.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '558' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:04:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 4d408249-474f-442c-9731-0d64c1321cba + x-ms-ratelimit-remaining-subscription-resource-requests: + - '496' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"dnsResolverOutboundEndpoints":[],"provisioningState":"Succeeded","resourceGuid":"2f7aee71-ef53-4329-ae0b-b3e5b17a3801"},"etag":"\"ab02ef09-0000-0100-0000-62554ea20000\"","location":"eastus","tags":{"key":"value2"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000002","name":"ruleset-000002","type":"Microsoft.Network/dnsForwardingRulesets","systemData":{"createdAt":"2022-04-12T10:03:28.8013639Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:04:10.0858313Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '628' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:04:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - ab46f73a-306f-4988-b7db-778d94fd927a + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"dnsResolverOutboundEndpoints":[],"provisioningState":"Succeeded","resourceGuid":"2f7aee71-ef53-4329-ae0b-b3e5b17a3801"},"etag":"\"ab02ef09-0000-0100-0000-62554ea20000\"","location":"eastus","tags":{"key":"value2"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000002","name":"ruleset-000002","type":"Microsoft.Network/dnsForwardingRulesets","systemData":{"createdAt":"2022-04-12T10:03:28.8013639Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:04:10.0858313Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '628' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:04:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - c091ed8f-5a58-47b5-b18b-a08c3e91902f + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g --no-wait --yes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000002?api-version=2020-04-01-preview + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiRGVsZXRlRG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjU0NjZiZTdiLTA4NDgtNDE3ZS1hMDZhLTI4NWZiY2MwYzUzNyJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 12 Apr 2022 10:04:51 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiRGVsZXRlRG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjU0NjZiZTdiLTA4NDgtNDE3ZS1hMDZhLTI4NWZiY2MwYzUzNyJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 66e0a9bc-b20e-4e9a-8ea7-310cbdb9b139 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +version: 1 diff --git a/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_vnet_crud.yaml b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_vnet_crud.yaml new file mode 100644 index 00000000000..8ee554063ca --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/tests/latest/recordings/test_dns_resolver_vnet_crud.yaml @@ -0,0 +1,1991 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T10:02:42Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:45 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": "eastus", "tags": {}, "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "dhcpOptions": {}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + Content-Length: + - '123' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"a3e90242-518c-46fb-a73f-7e763d5af1b6\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"eeeebd52-3deb-41bb-8ca8-524c314e675a\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/4171e9d5-8c13-473c-8dd1-448951658496?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '697' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - d973a179-c6fe-4181-99ea-664483ca6c9c + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/4171e9d5-8c13-473c-8dd1-448951658496?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:57 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-arm-service-request-id: + - f4c6772f-fc86-4efa-bce8-60a620c447b3 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"31b2b22e-ea57-4174-8dc0-8a55f0597c8d\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"eeeebd52-3deb-41bb-8ca8-524c314e675a\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:57 GMT + etag: + - W/"31b2b22e-ea57-4174-8dc0-8a55f0597c8d" + 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: + - 5a3a22d2-5256-431e-83da-097f2879ac89 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"31b2b22e-ea57-4174-8dc0-8a55f0597c8d\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"eeeebd52-3deb-41bb-8ca8-524c314e675a\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:02:58 GMT + etag: + - W/"31b2b22e-ea57-4174-8dc0-8a55f0597c8d" + 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: + - 5fd5dfd1-44f1-4c38-9a89-cc24f313d9f8 + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006", + "location": "eastus", "tags": {}, "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "dhcpOptions": {"dnsServers": []}, "subnets": [{"name": "subnet-000007", + "properties": {"addressPrefix": "10.0.0.0/24", "privateEndpointNetworkPolicies": + "Enabled", "privateLinkServiceNetworkPolicies": "Enabled"}}], "virtualNetworkPeerings": + [], "enableDdosProtection": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + Content-Length: + - '542' + Content-Type: + - application/json + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"2b3cf21b-3913-4453-ad2d-664c7b98c42b\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"eeeebd52-3deb-41bb-8ca8-524c314e675a\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000007\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007\",\r\n + \ \"etag\": \"W/\\\"2b3cf21b-3913-4453-ad2d-664c7b98c42b\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/8ca1fe29-b017-4a10-8a53-b680938d2775?api-version=2021-05-01 + cache-control: + - no-cache + content-length: + - '1339' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:00 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-arm-service-request-id: + - 9b63ba57-96a3-4ca3-945b-d31ac52c3ec8 + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/8ca1fe29-b017-4a10-8a53-b680938d2775?api-version=2021-05-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:03 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-arm-service-request-id: + - be0f6aee-6dec-4231-bc75-e24cbd6152a9 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name --address-prefixes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"d0d856b5-e43b-4c50-9c99-1796dc880cf6\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"eeeebd52-3deb-41bb-8ca8-524c314e675a\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000007\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007\",\r\n + \ \"etag\": \"W/\\\"d0d856b5-e43b-4c50-9c99-1796dc880cf6\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1341' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:04 GMT + etag: + - W/"d0d856b5-e43b-4c50-9c99-1796dc880cf6" + 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: + - a3866a78-ef0b-4643-975c-66c3c4019d7e + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"vnet-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006\",\r\n + \ \"etag\": \"W/\\\"d0d856b5-e43b-4c50-9c99-1796dc880cf6\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"eeeebd52-3deb-41bb-8ca8-524c314e675a\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"subnet-000007\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007\",\r\n + \ \"etag\": \"W/\\\"d0d856b5-e43b-4c50-9c99-1796dc880cf6\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1341' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:05 GMT + etag: + - W/"d0d856b5-e43b-4c50-9c99-1796dc880cf6" + 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: + - 784a7a2c-69c6-418c-90cb-b8355c8dd7c0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet show + Connection: + - keep-alive + ParameterSetName: + - -n -g --vnet-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007?api-version=2021-05-01 + response: + body: + string: "{\r\n \"name\": \"subnet-000007\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007\",\r\n + \ \"etag\": \"W/\\\"d0d856b5-e43b-4c50-9c99-1796dc880cf6\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '557' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:05 GMT + etag: + - W/"d0d856b5-e43b-4c50-9c99-1796dc880cf6" + 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: + - b0987811-50b3-431e-b7fb-1dab43650d97 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T10:02:42Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03: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": "eastus", "properties": {"virtualNetwork": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + Content-Length: + - '219' + Content-Type: + - application/json + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImI3ZDEzMWI0LTljYjctNGQwYS05ZGY1LWM2ZDE2ZjZhZjQ2MCJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:14 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImI3ZDEzMWI0LTljYjctNGQwYS05ZGY1LWM2ZDE2ZjZhZjQ2MCJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 5d77bc7d-bf1a-47ff-aafe-46beacf94987 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImI3ZDEzMWI0LTljYjctNGQwYS05ZGY1LWM2ZDE2ZjZhZjQ2MCJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImI3ZDEzMWI0LTljYjctNGQwYS05ZGY1LWM2ZDE2ZjZhZjQ2MCJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImI3ZDEzMWI0LTljYjctNGQwYS05ZGY1LWM2ZDE2ZjZhZjQ2MCJ9","startTime":"2022-04-12T10:03:15.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '494' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 1956368f-3851-4d48-8e70-5d87cdaeda6f + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImI3ZDEzMWI0LTljYjctNGQwYS05ZGY1LWM2ZDE2ZjZhZjQ2MCJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImI3ZDEzMWI0LTljYjctNGQwYS05ZGY1LWM2ZDE2ZjZhZjQ2MCJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zUmVzb2x2ZXIiLCJPcGVyYXRpb25JZCI6ImI3ZDEzMWI0LTljYjctNGQwYS05ZGY1LWM2ZDE2ZjZhZjQ2MCJ9","startTime":"2022-04-12T10:03:15.0000000Z","endTime":"2022-04-12T10:03:22.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '534' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 59e5c8bc-2fc9-46a6-98f2-b47b25af1b78 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver create + Connection: + - keep-alive + ParameterSetName: + - -n -g --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006"},"dnsResolverState":"Connected","provisioningState":"Succeeded","resourceGuid":"3e4e43f2-d4e0-4d12-aaf0-949fc6775710"},"etag":"\"1905ca0c-0000-0100-0000-62554e690000\"","location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005","name":"dns-resolver-000005","type":"Microsoft.Network/dnsResolvers","systemData":{"createdAt":"2022-04-12T10:03:14.3096797Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:03:14.3096797Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '771' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - ea7b3a16-33f6-4cfc-914a-6c3cf1843ba8 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T10:02:42Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + Content-Length: + - '233' + Content-Type: + - application/json + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005/outboundEndpoints/endpoint-000004?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:03:57 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - c3a54a23-7f42-4353-90d4-748827aadfe2 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=","startTime":"2022-04-12T10:03:58.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:04:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 59cd36dc-980c-4ec7-9a3f-66ca73fdc24a + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=","startTime":"2022-04-12T10:03:58.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:04:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - a23ca8ea-cd5a-4699-be16-baa2fe6552ae + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=","startTime":"2022-04-12T10:03:58.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '510' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:05:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - c0424b59-0e40-4d3a-b1a4-a8daf7a804c9 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '497' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0T3V0Ym91bmRFbmRwb2ludCIsIk9wZXJhdGlvbklkIjoiZTliYjk4OTQtNWQwZS00NjM4LThkYTAtMTkxNWJiNWE3OTNjIn0=","startTime":"2022-04-12T10:03:58.0000000Z","endTime":"2022-04-12T10:05:17.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '550' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:05:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 6cd99daf-c680-4762-812b-6b5e5cf1ab0f + x-ms-ratelimit-remaining-subscription-resource-requests: + - '496' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver outbound-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -n -g --dns-resolver-name --id + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005/outboundEndpoints/endpoint-000004?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006/subnets/subnet-000007"},"provisioningState":"Succeeded","resourceGuid":"ebcab80a-8c4a-4397-aa28-0becae6421e6"},"etag":"\"6001d6e7-0000-0100-0000-62554edc0000\"","location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005/outboundEndpoints/endpoint-000004","name":"endpoint-000004","type":"Microsoft.Network/dnsResolvers/outboundEndpoints","systemData":{"createdAt":"2022-04-12T10:03:57.6090571Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:03:57.6090571Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '802' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:05:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 56531634-c8cb-456c-b9a7-258e068b5a1a + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints + User-Agent: + - AZURECLI/2.35.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_dns_resolver_000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001","name":"cli_test_dns_resolver_000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-04-12T10:02:42Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '334' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:05:36 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": "eastus", "properties": {"dnsResolverOutboundEndpoints": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005/outboundEndpoints/endpoint-000004"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + Content-Length: + - '274' + Content-Type: + - application/json + ParameterSetName: + - -n -g --outbound-endpoints + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjkxNDQ1YWM0LTA3NjctNDFjYS1hZWMxLWEzMzYyZGQwMjQ5ZCJ9?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:05:42 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjkxNDQ1YWM0LTA3NjctNDFjYS1hZWMxLWEzMzYyZGQwMjQ5ZCJ9?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 6a1f589b-5a2b-4ed5-a8df-1dc5638993cd + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjkxNDQ1YWM0LTA3NjctNDFjYS1hZWMxLWEzMzYyZGQwMjQ5ZCJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjkxNDQ1YWM0LTA3NjctNDFjYS1hZWMxLWEzMzYyZGQwMjQ5ZCJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjkxNDQ1YWM0LTA3NjctNDFjYS1hZWMxLWEzMzYyZGQwMjQ5ZCJ9","startTime":"2022-04-12T10:05:42.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '518' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:05:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - bb5124b5-433f-47df-9006-31b450f723f7 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjkxNDQ1YWM0LTA3NjctNDFjYS1hZWMxLWEzMzYyZGQwMjQ5ZCJ9?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjkxNDQ1YWM0LTA3NjctNDFjYS1hZWMxLWEzMzYyZGQwMjQ5ZCJ9","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0RG5zRm9yd2FyZGluZ1J1bGVzZXQiLCJPcGVyYXRpb25JZCI6IjkxNDQ1YWM0LTA3NjctNDFjYS1hZWMxLWEzMzYyZGQwMjQ5ZCJ9","startTime":"2022-04-12T10:05:42.0000000Z","endTime":"2022-04-12T10:05:50.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '558' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:06:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - fa334ee1-55dc-4d0f-b8fd-fc9cec54c02d + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver forwarding-ruleset create + Connection: + - keep-alive + ParameterSetName: + - -n -g --outbound-endpoints + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"dnsResolverOutboundEndpoints":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsResolvers/dns-resolver-000005/outboundEndpoints/endpoint-000004"}],"provisioningState":"Succeeded","resourceGuid":"28af9ba8-706f-4e2b-a2b3-248005270813"},"etag":"\"ab028d0f-0000-0100-0000-62554efd0000\"","location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003","name":"ruleset-000003","type":"Microsoft.Network/dnsForwardingRulesets","systemData":{"createdAt":"2022-04-12T10:05:41.5274511Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:05:41.5274511Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '803' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:06:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 46f91ee6-43dc-4567-b9df-eb61b13ee836 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"virtualNetwork": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006"}, + "metadata": {"additionalProp": "value1"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver vnet-link create + Connection: + - keep-alive + Content-Length: + - '239' + Content-Type: + - application/json + ParameterSetName: + - -n -g --ruleset-name --id --metadata + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/virtualNetworkLinks/link-000002?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJmMjFlMzMyMC02NGVjLTRmOTEtOTg0NC00NjgzYWE4NjJkNTEifQ==?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:06:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJmMjFlMzMyMC02NGVjLTRmOTEtOTg0NC00NjgzYWE4NjJkNTEifQ==?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 067ab268-e37b-47c7-9cc4-c327b0ca0f7c + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver vnet-link create + Connection: + - keep-alive + ParameterSetName: + - -n -g --ruleset-name --id --metadata + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJmMjFlMzMyMC02NGVjLTRmOTEtOTg0NC00NjgzYWE4NjJkNTEifQ==?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJmMjFlMzMyMC02NGVjLTRmOTEtOTg0NC00NjgzYWE4NjJkNTEifQ==","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJmMjFlMzMyMC02NGVjLTRmOTEtOTg0NC00NjgzYWE4NjJkNTEifQ==","startTime":"2022-04-12T10:06:20.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '518' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:06:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 781ba977-f942-49fa-8998-949c6e416c9e + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver vnet-link create + Connection: + - keep-alive + ParameterSetName: + - -n -g --ruleset-name --id --metadata + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJmMjFlMzMyMC02NGVjLTRmOTEtOTg0NC00NjgzYWE4NjJkNTEifQ==?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJmMjFlMzMyMC02NGVjLTRmOTEtOTg0NC00NjgzYWE4NjJkNTEifQ==","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJmMjFlMzMyMC02NGVjLTRmOTEtOTg0NC00NjgzYWE4NjJkNTEifQ==","startTime":"2022-04-12T10:06:20.0000000Z","endTime":"2022-04-12T10:06:32.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '558' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:06:55 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 91ad471d-92be-4e52-89f9-9b0e708f3515 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver vnet-link create + Connection: + - keep-alive + ParameterSetName: + - -n -g --ruleset-name --id --metadata + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/virtualNetworkLinks/link-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006"},"provisioningState":"Succeeded","metadata":{"additionalProp":"value1"}},"etag":"\"ab022212-0000-0100-0000-62554f270000\"","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/virtualNetworkLinks/link-000002","name":"link-000002","type":"Microsoft.Network/dnsForwardingRulesets/virtualNetworkLinks","systemData":{"createdAt":"2022-04-12T10:06:19.9027177Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:06:19.9027177Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:06:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - ff04ae76-824c-4b35-b8b5-27e8721536bb + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver vnet-link list + Connection: + - keep-alive + ParameterSetName: + - -g --ruleset-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/virtualNetworkLinks?api-version=2020-04-01-preview + response: + body: + string: '{"value":[{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006"},"provisioningState":"Succeeded","metadata":{"additionalProp":"value1"}},"etag":"\"ab022212-0000-0100-0000-62554f270000\"","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/virtualNetworkLinks/link-000002","name":"link-000002","type":"Microsoft.Network/dnsForwardingRulesets/virtualNetworkLinks","systemData":{"createdAt":"2022-04-12T10:06:19.9027177Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:06:19.9027177Z","lastModifiedByType":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '774' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:06:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 75ee0804-2834-4905-9082-522b775462ae + x-ms-ratelimit-remaining-subscription-resource-entities-read: + - '59999' + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"metadata": {"additionalProp": "value2"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver vnet-link update + Connection: + - keep-alive + Content-Length: + - '58' + Content-Type: + - application/json + ParameterSetName: + - -n -g --ruleset-name --metadata + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/virtualNetworkLinks/link-000002?api-version=2020-04-01-preview + response: + body: + string: '{}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJlNjczYjg1YS0xN2Y1LTQ3NTQtYmQzNy0wMGQzOTFhZDc5ZDEifQ==?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '2' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:07:00 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJlNjczYjg1YS0xN2Y1LTQ3NTQtYmQzNy0wMGQzOTFhZDc5ZDEifQ==?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 104f0dc8-267f-44b2-9ef7-6f2fb93d699b + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver vnet-link update + Connection: + - keep-alive + ParameterSetName: + - -n -g --ruleset-name --metadata + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJlNjczYjg1YS0xN2Y1LTQ3NTQtYmQzNy0wMGQzOTFhZDc5ZDEifQ==?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJlNjczYjg1YS0xN2Y1LTQ3NTQtYmQzNy0wMGQzOTFhZDc5ZDEifQ==","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJlNjczYjg1YS0xN2Y1LTQ3NTQtYmQzNy0wMGQzOTFhZDc5ZDEifQ==","startTime":"2022-04-12T10:07:00.0000000Z","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '518' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:07:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - bb1c8fe4-f1f8-4aca-a1be-e3d660b2da0e + x-ms-ratelimit-remaining-subscription-resource-requests: + - '498' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver vnet-link update + Connection: + - keep-alive + ParameterSetName: + - -n -g --ruleset-name --metadata + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJlNjczYjg1YS0xN2Y1LTQ3NTQtYmQzNy0wMGQzOTFhZDc5ZDEifQ==?api-version=2020-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJlNjczYjg1YS0xN2Y1LTQ3NTQtYmQzNy0wMGQzOTFhZDc5ZDEifQ==","name":"eyJPcGVyYXRpb25UeXBlIjoiVXBzZXJ0VmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJlNjczYjg1YS0xN2Y1LTQ3NTQtYmQzNy0wMGQzOTFhZDc5ZDEifQ==","startTime":"2022-04-12T10:07:00.0000000Z","endTime":"2022-04-12T10:07:10.0000000Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '558' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:07:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 9dc4377e-dfe1-4e41-8fcd-470e216dd050 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '497' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver vnet-link update + Connection: + - keep-alive + ParameterSetName: + - -n -g --ruleset-name --metadata + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/virtualNetworkLinks/link-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006"},"provisioningState":"Succeeded","metadata":{"additionalProp":"value2"}},"etag":"\"ab021c14-0000-0100-0000-62554f4d0000\"","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/virtualNetworkLinks/link-000002","name":"link-000002","type":"Microsoft.Network/dnsForwardingRulesets/virtualNetworkLinks","systemData":{"createdAt":"2022-04-12T10:06:19.9027177Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:07:00.0036469Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:07:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 5fb262bd-93a7-4ea0-8bc7-54326995d7d9 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver vnet-link show + Connection: + - keep-alive + ParameterSetName: + - -n -g --ruleset-name + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/virtualNetworkLinks/link-000002?api-version=2020-04-01-preview + response: + body: + string: '{"properties":{"virtualNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/virtualNetworks/vnet-000006"},"provisioningState":"Succeeded","metadata":{"additionalProp":"value2"}},"etag":"\"ab021c14-0000-0100-0000-62554f4d0000\"","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/virtualNetworkLinks/link-000002","name":"link-000002","type":"Microsoft.Network/dnsForwardingRulesets/virtualNetworkLinks","systemData":{"createdAt":"2022-04-12T10:06:19.9027177Z","createdByType":"User","lastModifiedAt":"2022-04-12T10:07:00.0036469Z","lastModifiedByType":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 12 Apr 2022 10:07:40 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-activity-id: + - 863d3de7-ec74-41ed-9025-7d73cd1a47bd + x-ms-ratelimit-remaining-subscription-resource-requests: + - '499' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - dns-resolver vnet-link delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g --ruleset-name --no-wait --yes + User-Agent: + - AZURECLI/2.35.0 azsdk-python-mgmt-dnsresolver/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/dnsForwardingRulesets/ruleset-000003/virtualNetworkLinks/link-000002?api-version=2020-04-01-preview + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationStatuses/eyJPcGVyYXRpb25UeXBlIjoiRGVsZXRlVmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJkZWVlOGUxOC02ZTliLTRmODUtOTNkOC0wMjNiYzVlYmNiZTcifQ==?api-version=2020-04-01-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 12 Apr 2022 10:07:41 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_resolver_000001/providers/Microsoft.Network/locations/eastus/dnsResolverOperationResults/eyJPcGVyYXRpb25UeXBlIjoiRGVsZXRlVmlydHVhbE5ldHdvcmtMaW5rIiwiT3BlcmF0aW9uSWQiOiJkZWVlOGUxOC02ZTliLTRmODUtOTNkOC0wMjNiYzVlYmNiZTcifQ==?api-version=2020-04-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-activity-id: + - 2c40d723-d4e6-4580-8a29-869309e14dc5 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 202 + message: Accepted +version: 1 diff --git a/src/dns-resolver/azext_dnsresolver/tests/latest/test_dns_resolver_commands.py b/src/dns-resolver/azext_dnsresolver/tests/latest/test_dns_resolver_commands.py new file mode 100644 index 00000000000..ec58ccfc21b --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/tests/latest/test_dns_resolver_commands.py @@ -0,0 +1,260 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +from azure.cli.testsdk import ( + ResourceGroupPreparer, + ScenarioTest +) + + +class DnsResolverClientTest(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test_dns_resolver_', location='eastus') + def test_dns_resolver_crud(self): + self.kwargs.update({ + 'dns_resolver_name': self.create_random_name('dns-resolver-', 20), + 'vnet_name': self.create_random_name('vnet-', 12), + }) + + self.cmd('network vnet create -n {vnet_name} -g {rg}') + self.kwargs['vnet_id'] = self.cmd('network vnet show -n {vnet_name} -g {rg}').get_output_in_json()['id'] + + self.cmd( + 'dns-resolver create -n {dns_resolver_name} -g {rg} --id {vnet_id} --tags key=value1', + checks=[ + self.check('name', '{dns_resolver_name}'), + self.check('type', 'Microsoft.Network/dnsResolvers') + ] + ) + self.cmd( + 'dns-resolver list -g {rg}', + checks=[ + self.check('length(@)', 1), + self.check('[0].name', '{dns_resolver_name}') + ] + ) + self.cmd('dns-resolver update -n {dns_resolver_name} -g {rg} --tags key=value2') + self.cmd( + 'dns-resolver show -n {dns_resolver_name} -g {rg}', + checks=[ + self.check('name', '{dns_resolver_name}'), + self.check('tags.key', 'value2') + ] + ) + self.cmd('dns-resolver delete -n {dns_resolver_name} -g {rg} --no-wait --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_dns_resolver_', location='eastus') + def test_dns_resolver_inbound_crud(self): + self.kwargs.update({ + 'endpoint_name': self.create_random_name('endpoint-', 16), + 'dns_resolver_name': self.create_random_name('dns-resolver-', 20), + 'vnet_name': self.create_random_name('vnet-', 12), + 'subnet_name': self.create_random_name('subnet-', 12) + }) + + self.cmd('network vnet create -n {vnet_name} -g {rg}') + self.cmd('network vnet subnet create -n {subnet_name} -g {rg} --vnet-name {vnet_name} --address-prefixes 10.0.0.0/24') + self.kwargs['vnet_id'] = self.cmd('network vnet show -n {vnet_name} -g {rg}').get_output_in_json()['id'] + self.kwargs['subnet_id'] = self.cmd('network vnet subnet show -n {subnet_name} -g {rg} --vnet-name {vnet_name}').get_output_in_json()['id'] + self.cmd('dns-resolver create -n {dns_resolver_name} -g {rg} --id {vnet_id}') + + self.cmd( + 'dns-resolver inbound-endpoint create -n {endpoint_name} -g {rg} --dns-resolver-name {dns_resolver_name} ' + '--ip-configurations private-ip-address="" private-ip-allocation-method=Dynamic id={subnet_id} ' + '--tags key=value1', + checks=[ + self.check('name', '{endpoint_name}'), + self.check('type', 'Microsoft.Network/dnsResolvers/inboundEndpoints') + ] + ) + self.cmd( + 'dns-resolver inbound-endpoint list -g {rg} --dns-resolver-name {dns_resolver_name}', + checks=[ + self.check('length(@)', 1), + self.check('[0].name', '{endpoint_name}') + ] + ) + self.cmd('dns-resolver inbound-endpoint update -n {endpoint_name} -g {rg} --dns-resolver-name {dns_resolver_name} --tags key=value2') + self.cmd( + 'dns-resolver inbound-endpoint show -n {endpoint_name} -g {rg} --dns-resolver-name {dns_resolver_name}', + checks=[ + self.check('name', '{endpoint_name}'), + self.check('tags.key', 'value2') + ] + ) + self.cmd('dns-resolver inbound-endpoint delete -n {endpoint_name} -g {rg} --dns-resolver-name {dns_resolver_name} --no-wait --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_dns_resolver_', location='eastus') + def test_dns_resolver_outbound_crud(self): + self.kwargs.update({ + 'endpoint_name': self.create_random_name('endpoint-', 16), + 'dns_resolver_name': self.create_random_name('dns-resolver-', 20), + 'vnet_name': self.create_random_name('vnet-', 12), + 'subnet_name': self.create_random_name('subnet-', 12) + }) + + self.cmd('network vnet create -n {vnet_name} -g {rg}') + self.cmd('network vnet subnet create -n {subnet_name} -g {rg} --vnet-name {vnet_name} --address-prefixes 10.0.0.0/24') + self.kwargs['vnet_id'] = self.cmd('network vnet show -n {vnet_name} -g {rg}').get_output_in_json()['id'] + self.kwargs['subnet_id'] = self.cmd('network vnet subnet show -n {subnet_name} -g {rg} --vnet-name {vnet_name}').get_output_in_json()['id'] + self.cmd('dns-resolver create -n {dns_resolver_name} -g {rg} --id {vnet_id}') + + self.cmd( + 'dns-resolver outbound-endpoint create -n {endpoint_name} -g {rg} --dns-resolver-name {dns_resolver_name} ' + '--id={subnet_id} --tags key=value1', + checks=[ + self.check('name', '{endpoint_name}'), + self.check('type', 'Microsoft.Network/dnsResolvers/outboundEndpoints') + ] + ) + self.cmd( + 'dns-resolver outbound-endpoint list -g {rg} --dns-resolver-name {dns_resolver_name}', + checks=[ + self.check('length(@)', 1), + self.check('[0].name', '{endpoint_name}') + ] + ) + self.cmd('dns-resolver outbound-endpoint update -n {endpoint_name} -g {rg} --dns-resolver-name {dns_resolver_name} --tags key=value2') + self.cmd( + 'dns-resolver outbound-endpoint show -n {endpoint_name} -g {rg} --dns-resolver-name {dns_resolver_name}', + checks=[ + self.check('name', '{endpoint_name}'), + self.check('tags.key', 'value2') + ] + ) + self.cmd('dns-resolver outbound-endpoint delete -n {endpoint_name} -g {rg} --dns-resolver-name {dns_resolver_name} --no-wait --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_dns_resolver_', location='eastus') + def test_dns_resolver_ruleset_crud(self): + self.kwargs.update({ + 'ruleset_name': self.create_random_name('ruleset-', 12), + 'endpoint_name': self.create_random_name('endpoint-', 16), + 'dns_resolver_name': self.create_random_name('dns-resolver-', 20), + 'vnet_name': self.create_random_name('vnet-', 12), + 'subnet_name': self.create_random_name('subnet-', 12) + }) + + self.cmd('network vnet create -n {vnet_name} -g {rg}') + self.cmd('network vnet subnet create -n {subnet_name} -g {rg} --vnet-name {vnet_name} --address-prefixes 10.0.0.0/24') + self.kwargs['vnet_id'] = self.cmd('network vnet show -n {vnet_name} -g {rg}').get_output_in_json()['id'] + self.kwargs['subnet_id'] = self.cmd('network vnet subnet show -n {subnet_name} -g {rg} --vnet-name {vnet_name}').get_output_in_json()['id'] + self.cmd('dns-resolver create -n {dns_resolver_name} -g {rg} --id {vnet_id}') + self.kwargs['outbound_id'] = self.cmd('dns-resolver outbound-endpoint create -n {endpoint_name} -g {rg} --dns-resolver-name {dns_resolver_name} --id={subnet_id}').get_output_in_json()['id'] + + self.cmd( + 'dns-resolver forwarding-ruleset create -n {ruleset_name} -g {rg} ' + '--outbound-endpoints id={outbound_id} --tags key=value1', + checks=[ + self.check('name', '{ruleset_name}'), + self.check('type', 'Microsoft.Network/dnsForwardingRulesets') + ] + ) + self.cmd( + 'dns-resolver forwarding-ruleset list -g {rg}', + checks=[ + self.check('length(@)', 1), + self.check('[0].name', '{ruleset_name}') + ] + ) + self.cmd('dns-resolver forwarding-ruleset update -n {ruleset_name} -g {rg} --tags key=value2') + self.cmd( + 'dns-resolver forwarding-ruleset show -n {ruleset_name} -g {rg}', + checks=[ + self.check('name', '{ruleset_name}'), + self.check('tags.key', 'value2') + ] + ) + self.cmd('dns-resolver forwarding-ruleset delete -n {ruleset_name} -g {rg} --no-wait --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_dns_resolver_', location='eastus') + def test_dns_resolver_rule_crud(self): + self.kwargs.update({ + 'rule_name': self.create_random_name('rule-', 12), + 'ruleset_name': self.create_random_name('ruleset-', 12), + 'endpoint_name': self.create_random_name('endpoint-', 16), + 'dns_resolver_name': self.create_random_name('dns-resolver-', 20), + 'vnet_name': self.create_random_name('vnet-', 12), + 'subnet_name': self.create_random_name('subnet-', 12) + }) + + self.cmd('network vnet create -n {vnet_name} -g {rg}') + self.cmd('network vnet subnet create -n {subnet_name} -g {rg} --vnet-name {vnet_name} --address-prefixes 10.0.0.0/24') + self.kwargs['vnet_id'] = self.cmd('network vnet show -n {vnet_name} -g {rg}').get_output_in_json()['id'] + self.kwargs['subnet_id'] = self.cmd('network vnet subnet show -n {subnet_name} -g {rg} --vnet-name {vnet_name}').get_output_in_json()['id'] + self.cmd('dns-resolver create -n {dns_resolver_name} -g {rg} --id {vnet_id}') + self.kwargs['outbound_id'] = self.cmd('dns-resolver outbound-endpoint create -n {endpoint_name} -g {rg} --dns-resolver-name {dns_resolver_name} --id={subnet_id}').get_output_in_json()['id'] + self.cmd('dns-resolver forwarding-ruleset create -n {ruleset_name} -g {rg} --outbound-endpoints id={outbound_id}') + + self.cmd( + 'dns-resolver forwarding-rule create -n {rule_name} -g {rg} --ruleset-name {ruleset_name} ' + '--domain-name contoso.com. --forwarding-rule-state Enabled --metadata additionalProp=value1 ' + '--target-dns-servers ip-address=10.0.0.1 port=53', + checks=[ + self.check('name', '{rule_name}'), + self.check('type', 'Microsoft.Network/dnsForwardingRulesets/forwardingRules') + ] + ) + self.cmd( + 'dns-resolver forwarding-rule list -g {rg} --ruleset-name {ruleset_name}', + checks=[ + self.check('length(@)', 1), + self.check('[0].name', '{rule_name}') + ] + ) + self.cmd('dns-resolver forwarding-rule update -n {rule_name} -g {rg} --ruleset-name {ruleset_name} --forwarding-rule-state Disabled --metadata additionalProp=value2') + self.cmd( + 'dns-resolver forwarding-rule show -n {rule_name} -g {rg} --ruleset-name {ruleset_name}', + checks=[ + self.check('forwardingRuleState', 'Disabled'), + self.check('metadata.additionalProp', 'value2') + ] + ) + self.cmd('dns-resolver forwarding-rule delete -n {rule_name} -g {rg} --ruleset-name {ruleset_name} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_dns_resolver_', location='eastus') + def test_dns_resolver_vnet_crud(self): + self.kwargs.update({ + 'link_name': self.create_random_name('link-', 12), + 'ruleset_name': self.create_random_name('ruleset-', 12), + 'endpoint_name': self.create_random_name('endpoint-', 16), + 'dns_resolver_name': self.create_random_name('dns-resolver-', 20), + 'vnet_name': self.create_random_name('vnet-', 12), + 'subnet_name': self.create_random_name('subnet-', 12) + }) + + self.cmd('network vnet create -n {vnet_name} -g {rg}') + self.cmd('network vnet subnet create -n {subnet_name} -g {rg} --vnet-name {vnet_name} --address-prefixes 10.0.0.0/24') + self.kwargs['vnet_id'] = self.cmd('network vnet show -n {vnet_name} -g {rg}').get_output_in_json()['id'] + self.kwargs['subnet_id'] = self.cmd('network vnet subnet show -n {subnet_name} -g {rg} --vnet-name {vnet_name}').get_output_in_json()['id'] + self.cmd('dns-resolver create -n {dns_resolver_name} -g {rg} --id {vnet_id}') + self.kwargs['outbound_id'] = self.cmd('dns-resolver outbound-endpoint create -n {endpoint_name} -g {rg} --dns-resolver-name {dns_resolver_name} --id={subnet_id}').get_output_in_json()['id'] + self.cmd('dns-resolver forwarding-ruleset create -n {ruleset_name} -g {rg} --outbound-endpoints id={outbound_id}') + + self.cmd( + 'dns-resolver vnet-link create -n {link_name} -g {rg} --ruleset-name {ruleset_name} ' + '--id {vnet_id} --metadata additionalProp=value1', + checks=[ + self.check('name', '{link_name}'), + self.check('type', 'Microsoft.Network/dnsForwardingRulesets/virtualNetworkLinks') + ] + ) + self.cmd( + 'dns-resolver vnet-link list -g {rg} --ruleset-name {ruleset_name}', + checks=[ + self.check('length(@)', 1), + self.check('[0].name', '{link_name}') + ] + ) + self.cmd('dns-resolver vnet-link update -n {link_name} -g {rg} --ruleset-name {ruleset_name} --metadata additionalProp=value2') + self.cmd( + 'dns-resolver vnet-link show -n {link_name} -g {rg} --ruleset-name {ruleset_name}', + checks=[ + self.check('name', '{link_name}'), + self.check('metadata.additionalProp', 'value2') + ] + ) + self.cmd('dns-resolver vnet-link delete -n {link_name} -g {rg} --ruleset-name {ruleset_name} --no-wait --yes') diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/__init__.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/__init__.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/__init__.py new file mode 100644 index 00000000000..5a18889beb6 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._dns_resolver_management_client import DnsResolverManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['DnsResolverManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/_configuration.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/_configuration.py new file mode 100644 index 00000000000..60a4688c514 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class DnsResolverManagementClientConfiguration(Configuration): + """Configuration for DnsResolverManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(DnsResolverManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-04-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-dnsresolver/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/_dns_resolver_management_client.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/_dns_resolver_management_client.py new file mode 100644 index 00000000000..51f6109ef50 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/_dns_resolver_management_client.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import DnsResolverManagementClientConfiguration +from .operations import DnsResolversOperations +from .operations import InboundEndpointsOperations +from .operations import OutboundEndpointsOperations +from .operations import DnsForwardingRulesetsOperations +from .operations import ForwardingRulesOperations +from .operations import VirtualNetworkLinksOperations +from . import models + + +class DnsResolverManagementClient(object): + """The DNS Resolver Management Client. + + :ivar dns_resolvers: DnsResolversOperations operations + :vartype dns_resolvers: azure.mgmt.dnsresolver.operations.DnsResolversOperations + :ivar inbound_endpoints: InboundEndpointsOperations operations + :vartype inbound_endpoints: azure.mgmt.dnsresolver.operations.InboundEndpointsOperations + :ivar outbound_endpoints: OutboundEndpointsOperations operations + :vartype outbound_endpoints: azure.mgmt.dnsresolver.operations.OutboundEndpointsOperations + :ivar dns_forwarding_rulesets: DnsForwardingRulesetsOperations operations + :vartype dns_forwarding_rulesets: azure.mgmt.dnsresolver.operations.DnsForwardingRulesetsOperations + :ivar forwarding_rules: ForwardingRulesOperations operations + :vartype forwarding_rules: azure.mgmt.dnsresolver.operations.ForwardingRulesOperations + :ivar virtual_network_links: VirtualNetworkLinksOperations operations + :vartype virtual_network_links: azure.mgmt.dnsresolver.operations.VirtualNetworkLinksOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = DnsResolverManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.dns_resolvers = DnsResolversOperations( + self._client, self._config, self._serialize, self._deserialize) + self.inbound_endpoints = InboundEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.outbound_endpoints = OutboundEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dns_forwarding_rulesets = DnsForwardingRulesetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.forwarding_rules = ForwardingRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_network_links = VirtualNetworkLinksOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DnsResolverManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/_version.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/_version.py new file mode 100644 index 00000000000..e5754a47ce6 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/__init__.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/__init__.py new file mode 100644 index 00000000000..1522133117b --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._dns_resolver_management_client import DnsResolverManagementClient +__all__ = ['DnsResolverManagementClient'] diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/_configuration.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/_configuration.py new file mode 100644 index 00000000000..08b916cf983 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class DnsResolverManagementClientConfiguration(Configuration): + """Configuration for DnsResolverManagementClient. + + 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(DnsResolverManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-04-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-dnsresolver/{}'.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/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/_dns_resolver_management_client.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/_dns_resolver_management_client.py new file mode 100644 index 00000000000..8b9c4cadbbc --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/_dns_resolver_management_client.py @@ -0,0 +1,89 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 DnsResolverManagementClientConfiguration +from .operations import DnsResolversOperations +from .operations import InboundEndpointsOperations +from .operations import OutboundEndpointsOperations +from .operations import DnsForwardingRulesetsOperations +from .operations import ForwardingRulesOperations +from .operations import VirtualNetworkLinksOperations +from .. import models + + +class DnsResolverManagementClient(object): + """The DNS Resolver Management Client. + + :ivar dns_resolvers: DnsResolversOperations operations + :vartype dns_resolvers: azure.mgmt.dnsresolver.aio.operations.DnsResolversOperations + :ivar inbound_endpoints: InboundEndpointsOperations operations + :vartype inbound_endpoints: azure.mgmt.dnsresolver.aio.operations.InboundEndpointsOperations + :ivar outbound_endpoints: OutboundEndpointsOperations operations + :vartype outbound_endpoints: azure.mgmt.dnsresolver.aio.operations.OutboundEndpointsOperations + :ivar dns_forwarding_rulesets: DnsForwardingRulesetsOperations operations + :vartype dns_forwarding_rulesets: azure.mgmt.dnsresolver.aio.operations.DnsForwardingRulesetsOperations + :ivar forwarding_rules: ForwardingRulesOperations operations + :vartype forwarding_rules: azure.mgmt.dnsresolver.aio.operations.ForwardingRulesOperations + :ivar virtual_network_links: VirtualNetworkLinksOperations operations + :vartype virtual_network_links: azure.mgmt.dnsresolver.aio.operations.VirtualNetworkLinksOperations + :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = DnsResolverManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.dns_resolvers = DnsResolversOperations( + self._client, self._config, self._serialize, self._deserialize) + self.inbound_endpoints = InboundEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.outbound_endpoints = OutboundEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dns_forwarding_rulesets = DnsForwardingRulesetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.forwarding_rules = ForwardingRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_network_links = VirtualNetworkLinksOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "DnsResolverManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/__init__.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/__init__.py new file mode 100644 index 00000000000..6656675bef0 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/__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 ._dns_resolvers_operations import DnsResolversOperations +from ._inbound_endpoints_operations import InboundEndpointsOperations +from ._outbound_endpoints_operations import OutboundEndpointsOperations +from ._dns_forwarding_rulesets_operations import DnsForwardingRulesetsOperations +from ._forwarding_rules_operations import ForwardingRulesOperations +from ._virtual_network_links_operations import VirtualNetworkLinksOperations + +__all__ = [ + 'DnsResolversOperations', + 'InboundEndpointsOperations', + 'OutboundEndpointsOperations', + 'DnsForwardingRulesetsOperations', + 'ForwardingRulesOperations', + 'VirtualNetworkLinksOperations', +] diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_dns_forwarding_rulesets_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_dns_forwarding_rulesets_operations.py new file mode 100644 index 00000000000..46f5f18ab83 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_dns_forwarding_rulesets_operations.py @@ -0,0 +1,729 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DnsForwardingRulesetsOperations: + """DnsForwardingRulesetsOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + parameters: "models.DnsForwardingRuleset", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs + ) -> Optional["models.DnsForwardingRuleset"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DnsForwardingRuleset"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.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), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'DnsForwardingRuleset') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DnsForwardingRuleset', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DnsForwardingRuleset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + parameters: "models.DnsForwardingRuleset", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.DnsForwardingRuleset"]: + """Creates or updates a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.DnsForwardingRuleset + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DnsForwardingRuleset or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dnsresolver.models.DnsForwardingRuleset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsForwardingRuleset"] + 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( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DnsForwardingRuleset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + parameters: "models.DnsForwardingRulesetPatch", + if_match: Optional[str] = None, + **kwargs + ) -> Optional["models.DnsForwardingRuleset"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DnsForwardingRuleset"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.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), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'DnsForwardingRulesetPatch') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DnsForwardingRuleset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + parameters: "models.DnsForwardingRulesetPatch", + if_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.DnsForwardingRuleset"]: + """Updates a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.DnsForwardingRulesetPatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DnsForwardingRuleset or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dnsresolver.models.DnsForwardingRuleset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsForwardingRuleset"] + 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( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + parameters=parameters, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DnsForwardingRuleset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a DNS forwarding ruleset. WARNING: This operation cannot be undone. All forwarding + rules within the ruleset will be deleted. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + **kwargs + ) -> "models.DnsForwardingRuleset": + """Gets a DNS forwarding ruleset properties. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DnsForwardingRuleset, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.DnsForwardingRuleset + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsForwardingRuleset"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[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('DnsForwardingRuleset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.DnsForwardingRulesetListResult"]: + """Lists DNS forwarding rulesets within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DnsForwardingRulesetListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dnsresolver.models.DnsForwardingRulesetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsForwardingRulesetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('DnsForwardingRulesetListResult', 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.Network/dnsForwardingRulesets'} # type: ignore + + def list( + self, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.DnsForwardingRulesetListResult"]: + """Lists DNS forwarding rulesets in all resource groups of a subscription. + + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DnsForwardingRulesetListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dnsresolver.models.DnsForwardingRulesetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsForwardingRulesetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('DnsForwardingRulesetListResult', 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.Network/dnsForwardingRulesets'} # type: ignore + + def list_by_virtual_network( + self, + resource_group_name: str, + virtual_network_name: str, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.VirtualNetworkDnsForwardingRulesetListResult"]: + """Lists DNS forwarding ruleset resource IDs attached to a virtual network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkDnsForwardingRulesetListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dnsresolver.models.VirtualNetworkDnsForwardingRulesetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkDnsForwardingRulesetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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_virtual_network.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), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkDnsForwardingRulesetListResult', 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_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listDnsForwardingRulesets'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_dns_resolvers_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_dns_resolvers_operations.py new file mode 100644 index 00000000000..170a251501a --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_dns_resolvers_operations.py @@ -0,0 +1,728 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DnsResolversOperations: + """DnsResolversOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + dns_resolver_name: str, + parameters: "models.DnsResolver", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs + ) -> Optional["models.DnsResolver"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DnsResolver"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'DnsResolver') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DnsResolver', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DnsResolver', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + dns_resolver_name: str, + parameters: "models.DnsResolver", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.DnsResolver"]: + """Creates or updates a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.DnsResolver + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DnsResolver or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dnsresolver.models.DnsResolver] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsResolver"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DnsResolver', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + dns_resolver_name: str, + parameters: "models.DnsResolverPatch", + if_match: Optional[str] = None, + **kwargs + ) -> Optional["models.DnsResolver"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DnsResolver"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'DnsResolverPatch') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DnsResolver', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + dns_resolver_name: str, + parameters: "models.DnsResolverPatch", + if_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.DnsResolver"]: + """Updates a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.DnsResolverPatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DnsResolver or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dnsresolver.models.DnsResolver] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsResolver"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + parameters=parameters, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DnsResolver', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + dns_resolver_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + dns_resolver_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a DNS resolver. WARNING: This operation cannot be undone. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + dns_resolver_name: str, + **kwargs + ) -> "models.DnsResolver": + """Gets properties of a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DnsResolver, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.DnsResolver + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsResolver"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[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('DnsResolver', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.DnsResolverListResult"]: + """Lists DNS resolvers within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DnsResolverListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dnsresolver.models.DnsResolverListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsResolverListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('DnsResolverListResult', 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.Network/dnsResolvers'} # type: ignore + + def list( + self, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.DnsResolverListResult"]: + """Lists DNS resolvers in all resource groups of a subscription. + + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DnsResolverListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dnsresolver.models.DnsResolverListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsResolverListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('DnsResolverListResult', 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.Network/dnsResolvers'} # type: ignore + + def list_by_virtual_network( + self, + resource_group_name: str, + virtual_network_name: str, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.SubResourceListResult"]: + """Lists DNS resolver resource IDs linked to a virtual network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SubResourceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dnsresolver.models.SubResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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_virtual_network.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), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SubResourceListResult', 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_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listDnsResolvers'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_forwarding_rules_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_forwarding_rules_operations.py new file mode 100644 index 00000000000..d34cbe99743 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_forwarding_rules_operations.py @@ -0,0 +1,415 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ForwardingRulesOperations: + """ForwardingRulesOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create_or_update( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + forwarding_rule_name: str, + parameters: "models.ForwardingRule", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs + ) -> "models.ForwardingRule": + """Creates or updates a forwarding rule in a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param forwarding_rule_name: The name of the forwarding rule. + :type forwarding_rule_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.ForwardingRule + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ForwardingRule, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ForwardingRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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 = { + '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), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'forwardingRuleName': self._serialize.url("forwarding_rule_name", forwarding_rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'ForwardingRule') + 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('ForwardingRule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ForwardingRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + forwarding_rule_name: str, + parameters: "models.ForwardingRulePatch", + if_match: Optional[str] = None, + **kwargs + ) -> "models.ForwardingRule": + """Updates a forwarding rule in a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param forwarding_rule_name: The name of the forwarding rule. + :type forwarding_rule_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.ForwardingRulePatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ForwardingRule, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ForwardingRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'forwardingRuleName': self._serialize.url("forwarding_rule_name", forwarding_rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'ForwardingRulePatch') + 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('ForwardingRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + forwarding_rule_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> None: + """Deletes a forwarding rule in a DNS forwarding ruleset. WARNING: This operation cannot be + undone. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param forwarding_rule_name: The name of the forwarding rule. + :type forwarding_rule_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: 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-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'forwardingRuleName': self._serialize.url("forwarding_rule_name", forwarding_rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + forwarding_rule_name: str, + **kwargs + ) -> "models.ForwardingRule": + """Gets properties of a forwarding rule in a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param forwarding_rule_name: The name of the forwarding rule. + :type forwarding_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ForwardingRule, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ForwardingRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'forwardingRuleName': self._serialize.url("forwarding_rule_name", forwarding_rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[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('ForwardingRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore + + def list( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.ForwardingRuleListResult"]: + """Lists forwarding rules in a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ForwardingRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dnsresolver.models.ForwardingRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ForwardingRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('ForwardingRuleListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_inbound_endpoints_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_inbound_endpoints_operations.py new file mode 100644 index 00000000000..2395551dc07 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_inbound_endpoints_operations.py @@ -0,0 +1,605 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class InboundEndpointsOperations: + """InboundEndpointsOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + dns_resolver_name: str, + inbound_endpoint_name: str, + parameters: "models.InboundEndpoint", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs + ) -> Optional["models.InboundEndpoint"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.InboundEndpoint"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'InboundEndpoint') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('InboundEndpoint', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('InboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + dns_resolver_name: str, + inbound_endpoint_name: str, + parameters: "models.InboundEndpoint", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.InboundEndpoint"]: + """Creates or updates an inbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param inbound_endpoint_name: The name of the inbound endpoint for the DNS resolver. + :type inbound_endpoint_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.InboundEndpoint + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either InboundEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dnsresolver.models.InboundEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundEndpoint"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + inbound_endpoint_name=inbound_endpoint_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('InboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + dns_resolver_name: str, + inbound_endpoint_name: str, + parameters: "models.InboundEndpointPatch", + if_match: Optional[str] = None, + **kwargs + ) -> Optional["models.InboundEndpoint"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.InboundEndpoint"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'InboundEndpointPatch') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('InboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + dns_resolver_name: str, + inbound_endpoint_name: str, + parameters: "models.InboundEndpointPatch", + if_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.InboundEndpoint"]: + """Updates an inbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param inbound_endpoint_name: The name of the inbound endpoint for the DNS resolver. + :type inbound_endpoint_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.InboundEndpointPatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either InboundEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dnsresolver.models.InboundEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundEndpoint"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + inbound_endpoint_name=inbound_endpoint_name, + parameters=parameters, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('InboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + dns_resolver_name: str, + inbound_endpoint_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + dns_resolver_name: str, + inbound_endpoint_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an inbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param inbound_endpoint_name: The name of the inbound endpoint for the DNS resolver. + :type inbound_endpoint_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + inbound_endpoint_name=inbound_endpoint_name, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + dns_resolver_name: str, + inbound_endpoint_name: str, + **kwargs + ) -> "models.InboundEndpoint": + """Gets properties of an inbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param inbound_endpoint_name: The name of the inbound endpoint for the DNS resolver. + :type inbound_endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: InboundEndpoint, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.InboundEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[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('InboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + def list( + self, + resource_group_name: str, + dns_resolver_name: str, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.InboundEndpointListResult"]: + """Lists inbound endpoints for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InboundEndpointListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dnsresolver.models.InboundEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundEndpointListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('InboundEndpointListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_outbound_endpoints_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_outbound_endpoints_operations.py new file mode 100644 index 00000000000..1f92484598a --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_outbound_endpoints_operations.py @@ -0,0 +1,605 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OutboundEndpointsOperations: + """OutboundEndpointsOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + dns_resolver_name: str, + outbound_endpoint_name: str, + parameters: "models.OutboundEndpoint", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs + ) -> Optional["models.OutboundEndpoint"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OutboundEndpoint"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'OutboundEndpoint') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OutboundEndpoint', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('OutboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + dns_resolver_name: str, + outbound_endpoint_name: str, + parameters: "models.OutboundEndpoint", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.OutboundEndpoint"]: + """Creates or updates an outbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param outbound_endpoint_name: The name of the outbound endpoint for the DNS resolver. + :type outbound_endpoint_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.OutboundEndpoint + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OutboundEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dnsresolver.models.OutboundEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundEndpoint"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + outbound_endpoint_name=outbound_endpoint_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OutboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + dns_resolver_name: str, + outbound_endpoint_name: str, + parameters: "models.OutboundEndpointPatch", + if_match: Optional[str] = None, + **kwargs + ) -> Optional["models.OutboundEndpoint"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OutboundEndpoint"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'OutboundEndpointPatch') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OutboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + dns_resolver_name: str, + outbound_endpoint_name: str, + parameters: "models.OutboundEndpointPatch", + if_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.OutboundEndpoint"]: + """Updates an outbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param outbound_endpoint_name: The name of the outbound endpoint for the DNS resolver. + :type outbound_endpoint_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.OutboundEndpointPatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OutboundEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dnsresolver.models.OutboundEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundEndpoint"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + outbound_endpoint_name=outbound_endpoint_name, + parameters=parameters, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OutboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + dns_resolver_name: str, + outbound_endpoint_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + dns_resolver_name: str, + outbound_endpoint_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an outbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param outbound_endpoint_name: The name of the outbound endpoint for the DNS resolver. + :type outbound_endpoint_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + outbound_endpoint_name=outbound_endpoint_name, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + dns_resolver_name: str, + outbound_endpoint_name: str, + **kwargs + ) -> "models.OutboundEndpoint": + """Gets properties of an outbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param outbound_endpoint_name: The name of the outbound endpoint for the DNS resolver. + :type outbound_endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OutboundEndpoint, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.OutboundEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[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('OutboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + def list( + self, + resource_group_name: str, + dns_resolver_name: str, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.OutboundEndpointListResult"]: + """Lists outbound endpoints for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEndpointListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dnsresolver.models.OutboundEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundEndpointListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('OutboundEndpointListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_virtual_network_links_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_virtual_network_links_operations.py new file mode 100644 index 00000000000..b9753309c74 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/aio/operations/_virtual_network_links_operations.py @@ -0,0 +1,606 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworkLinksOperations: + """VirtualNetworkLinksOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + virtual_network_link_name: str, + parameters: "models.VirtualNetworkLink", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs + ) -> Optional["models.VirtualNetworkLink"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkLink"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.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), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'VirtualNetworkLink') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkLink', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + virtual_network_link_name: str, + parameters: "models.VirtualNetworkLink", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.VirtualNetworkLink"]: + """Creates or updates a virtual network link to a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param virtual_network_link_name: The name of the virtual network link. + :type virtual_network_link_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.VirtualNetworkLink + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualNetworkLink or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dnsresolver.models.VirtualNetworkLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkLink"] + 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( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + virtual_network_link_name=virtual_network_link_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + virtual_network_link_name: str, + parameters: "models.VirtualNetworkLinkPatch", + if_match: Optional[str] = None, + **kwargs + ) -> Optional["models.VirtualNetworkLink"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkLink"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.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), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'VirtualNetworkLinkPatch') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + virtual_network_link_name: str, + parameters: "models.VirtualNetworkLinkPatch", + if_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.VirtualNetworkLink"]: + """Updates a virtual network link to a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param virtual_network_link_name: The name of the virtual network link. + :type virtual_network_link_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.VirtualNetworkLinkPatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualNetworkLink or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dnsresolver.models.VirtualNetworkLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkLink"] + 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( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + virtual_network_link_name=virtual_network_link_name, + parameters=parameters, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + virtual_network_link_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + virtual_network_link_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a virtual network link to a DNS forwarding ruleset. WARNING: This operation cannot be + undone. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param virtual_network_link_name: The name of the virtual network link. + :type virtual_network_link_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + virtual_network_link_name=virtual_network_link_name, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + virtual_network_link_name: str, + **kwargs + ) -> "models.VirtualNetworkLink": + """Gets properties of a virtual network link to a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param virtual_network_link_name: The name of the virtual network link. + :type virtual_network_link_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkLink, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.VirtualNetworkLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkLink"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[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('VirtualNetworkLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + def list( + self, + resource_group_name: str, + dns_forwarding_ruleset_name: str, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.VirtualNetworkLinkListResult"]: + """Lists virtual network links to a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkLinkListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dnsresolver.models.VirtualNetworkLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkLinkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('VirtualNetworkLinkListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/__init__.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/__init__.py new file mode 100644 index 00000000000..8631de2360e --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/__init__.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import CloudErrorBody + from ._models_py3 import DnsForwardingRuleset + from ._models_py3 import DnsForwardingRulesetListResult + from ._models_py3 import DnsForwardingRulesetPatch + from ._models_py3 import DnsResolver + from ._models_py3 import DnsResolverListResult + from ._models_py3 import DnsResolverPatch + from ._models_py3 import ForwardingRule + from ._models_py3 import ForwardingRuleListResult + from ._models_py3 import ForwardingRulePatch + from ._models_py3 import InboundEndpoint + from ._models_py3 import InboundEndpointListResult + from ._models_py3 import InboundEndpointPatch + from ._models_py3 import IpConfiguration + from ._models_py3 import OutboundEndpoint + from ._models_py3 import OutboundEndpointListResult + from ._models_py3 import OutboundEndpointPatch + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import SubResource + from ._models_py3 import SubResourceListResult + from ._models_py3 import SystemData + from ._models_py3 import TargetDnsServer + from ._models_py3 import TrackedResource + from ._models_py3 import VirtualNetworkDnsForwardingRuleset + from ._models_py3 import VirtualNetworkDnsForwardingRulesetListResult + from ._models_py3 import VirtualNetworkLink + from ._models_py3 import VirtualNetworkLinkListResult + from ._models_py3 import VirtualNetworkLinkPatch +except (SyntaxError, ImportError): + from ._models import CloudErrorBody # type: ignore + from ._models import DnsForwardingRuleset # type: ignore + from ._models import DnsForwardingRulesetListResult # type: ignore + from ._models import DnsForwardingRulesetPatch # type: ignore + from ._models import DnsResolver # type: ignore + from ._models import DnsResolverListResult # type: ignore + from ._models import DnsResolverPatch # type: ignore + from ._models import ForwardingRule # type: ignore + from ._models import ForwardingRuleListResult # type: ignore + from ._models import ForwardingRulePatch # type: ignore + from ._models import InboundEndpoint # type: ignore + from ._models import InboundEndpointListResult # type: ignore + from ._models import InboundEndpointPatch # type: ignore + from ._models import IpConfiguration # type: ignore + from ._models import OutboundEndpoint # type: ignore + from ._models import OutboundEndpointListResult # type: ignore + from ._models import OutboundEndpointPatch # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + from ._models import SubResource # type: ignore + from ._models import SubResourceListResult # type: ignore + from ._models import SystemData # type: ignore + from ._models import TargetDnsServer # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import VirtualNetworkDnsForwardingRuleset # type: ignore + from ._models import VirtualNetworkDnsForwardingRulesetListResult # type: ignore + from ._models import VirtualNetworkLink # type: ignore + from ._models import VirtualNetworkLinkListResult # type: ignore + from ._models import VirtualNetworkLinkPatch # type: ignore + +from ._dns_resolver_management_client_enums import ( + CreatedByType, + DnsResolverState, + ForwardingRuleState, + IpAllocationMethod, + ProvisioningState, +) + +__all__ = [ + 'CloudErrorBody', + 'DnsForwardingRuleset', + 'DnsForwardingRulesetListResult', + 'DnsForwardingRulesetPatch', + 'DnsResolver', + 'DnsResolverListResult', + 'DnsResolverPatch', + 'ForwardingRule', + 'ForwardingRuleListResult', + 'ForwardingRulePatch', + 'InboundEndpoint', + 'InboundEndpointListResult', + 'InboundEndpointPatch', + 'IpConfiguration', + 'OutboundEndpoint', + 'OutboundEndpointListResult', + 'OutboundEndpointPatch', + 'ProxyResource', + 'Resource', + 'SubResource', + 'SubResourceListResult', + 'SystemData', + 'TargetDnsServer', + 'TrackedResource', + 'VirtualNetworkDnsForwardingRuleset', + 'VirtualNetworkDnsForwardingRulesetListResult', + 'VirtualNetworkLink', + 'VirtualNetworkLinkListResult', + 'VirtualNetworkLinkPatch', + 'CreatedByType', + 'DnsResolverState', + 'ForwardingRuleState', + 'IpAllocationMethod', + 'ProvisioningState', +] diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/_dns_resolver_management_client_enums.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/_dns_resolver_management_client_enums.py new file mode 100644 index 00000000000..96f4c2b8f8d --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/_dns_resolver_management_client_enums.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class DnsResolverState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the DNS resolver. This is a read-only property and any attempt to set + this value will be ignored. + """ + + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + +class ForwardingRuleState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The state of forwarding rule. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class IpAllocationMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Private IP address allocation method. + """ + + STATIC = "Static" + DYNAMIC = "Dynamic" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state of the resource. + """ + + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/_models.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/_models.py new file mode 100644 index 00000000000..e5d76674f08 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/_models.py @@ -0,0 +1,1059 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 CloudErrorBody(msrest.serialization.Model): + """The body of an error message. + + :param code: The error code. + :type code: str + :param message: A description of what caused the error. + :type message: str + :param target: The target resource of the error message. + :type target: str + :param details: Extra error information. + :type details: list[~azure.mgmt.dnsresolver.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 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 TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + + +class DnsForwardingRuleset(TrackedResource): + """Describes a DNS forwarding ruleset. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar etag: ETag of the DNS forwarding ruleset. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param dns_resolver_outbound_endpoints: The reference to the DNS resolver outbound endpoints + that are used to route DNS queries matching the forwarding rules in the ruleset to the target + DNS servers. + :type dns_resolver_outbound_endpoints: list[~azure.mgmt.dnsresolver.models.SubResource] + :ivar provisioning_state: The current provisioning state of the DNS forwarding ruleset. This is + a read-only property and any attempt to set this value will be ignored. Possible values + include: "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + :ivar resource_guid: The resourceGuid for the DNS forwarding ruleset. + :vartype resource_guid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'dns_resolver_outbound_endpoints': {'key': 'properties.dnsResolverOutboundEndpoints', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DnsForwardingRuleset, self).__init__(**kwargs) + self.etag = None + self.system_data = None + self.dns_resolver_outbound_endpoints = kwargs.get('dns_resolver_outbound_endpoints', None) + self.provisioning_state = None + self.resource_guid = None + + +class DnsForwardingRulesetListResult(msrest.serialization.Model): + """The response to an enumeration operation on DNS forwarding rulesets. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the DNS forwarding rulesets. + :type value: list[~azure.mgmt.dnsresolver.models.DnsForwardingRuleset] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DnsForwardingRuleset]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DnsForwardingRulesetListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class DnsForwardingRulesetPatch(msrest.serialization.Model): + """Describes a DNS forwarding ruleset PATCH operation. + + :param tags: A set of tags. Tags for DNS Resolver. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DnsForwardingRulesetPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class DnsResolver(TrackedResource): + """Describes a DNS resolver. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar etag: ETag of the DNS resolver. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param virtual_network: The reference to the virtual network. This cannot be changed after + creation. + :type virtual_network: ~azure.mgmt.dnsresolver.models.SubResource + :ivar dns_resolver_state: The current status of the DNS resolver. This is a read-only property + and any attempt to set this value will be ignored. Possible values include: "Connected", + "Disconnected". + :vartype dns_resolver_state: str or ~azure.mgmt.dnsresolver.models.DnsResolverState + :ivar provisioning_state: The current provisioning state of the DNS resolver. This is a read- + only property and any attempt to set this value will be ignored. Possible values include: + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + :ivar resource_guid: The resourceGuid property of the DNS resolver resource. + :vartype resource_guid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, + 'dns_resolver_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'SubResource'}, + 'dns_resolver_state': {'key': 'properties.dnsResolverState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DnsResolver, self).__init__(**kwargs) + self.etag = None + self.system_data = None + self.virtual_network = kwargs.get('virtual_network', None) + self.dns_resolver_state = None + self.provisioning_state = None + self.resource_guid = None + + +class DnsResolverListResult(msrest.serialization.Model): + """The response to an enumeration operation on DNS resolvers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the DNS resolvers. + :type value: list[~azure.mgmt.dnsresolver.models.DnsResolver] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DnsResolver]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DnsResolverListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class DnsResolverPatch(msrest.serialization.Model): + """Describes a DNS resolver for PATCH operation. + + :param tags: A set of tags. Tags for DNS Resolver. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DnsResolverPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class ForwardingRule(Resource): + """Describes a forwarding rule within a DNS forwarding ruleset. + + 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 etag: ETag of the forwarding rule. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param domain_name: The domain name for the forwarding rule. + :type domain_name: str + :param target_dns_servers: DNS servers to forward the DNS query to. + :type target_dns_servers: list[~azure.mgmt.dnsresolver.models.TargetDnsServer] + :param metadata: Metadata attached to the forwarding rule. + :type metadata: dict[str, str] + :param forwarding_rule_state: The state of forwarding rule. Possible values include: "Enabled", + "Disabled". + :type forwarding_rule_state: str or ~azure.mgmt.dnsresolver.models.ForwardingRuleState + :ivar provisioning_state: The current provisioning state of the forwarding rule. This is a + read-only property and any attempt to set this value will be ignored. Possible values include: + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'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'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'target_dns_servers': {'key': 'properties.targetDnsServers', 'type': '[TargetDnsServer]'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'forwarding_rule_state': {'key': 'properties.forwardingRuleState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ForwardingRule, self).__init__(**kwargs) + self.etag = None + self.system_data = None + self.domain_name = kwargs.get('domain_name', None) + self.target_dns_servers = kwargs.get('target_dns_servers', None) + self.metadata = kwargs.get('metadata', None) + self.forwarding_rule_state = kwargs.get('forwarding_rule_state', None) + self.provisioning_state = None + + +class ForwardingRuleListResult(msrest.serialization.Model): + """The response to an enumeration operation on forwarding rules within a DNS forwarding ruleset. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the forwarding rules. + :type value: list[~azure.mgmt.dnsresolver.models.ForwardingRule] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ForwardingRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ForwardingRuleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ForwardingRulePatch(msrest.serialization.Model): + """Describes a forwarding rule for PATCH operation. + + :param target_dns_servers: DNS servers to forward the DNS query to. + :type target_dns_servers: list[~azure.mgmt.dnsresolver.models.TargetDnsServer] + :param metadata: Metadata attached to the forwarding rule. + :type metadata: dict[str, str] + :param forwarding_rule_state: The state of forwarding rule. Possible values include: "Enabled", + "Disabled". + :type forwarding_rule_state: str or ~azure.mgmt.dnsresolver.models.ForwardingRuleState + """ + + _attribute_map = { + 'target_dns_servers': {'key': 'properties.targetDnsServers', 'type': '[TargetDnsServer]'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'forwarding_rule_state': {'key': 'properties.forwardingRuleState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ForwardingRulePatch, self).__init__(**kwargs) + self.target_dns_servers = kwargs.get('target_dns_servers', None) + self.metadata = kwargs.get('metadata', None) + self.forwarding_rule_state = kwargs.get('forwarding_rule_state', None) + + +class InboundEndpoint(TrackedResource): + """Describes an inbound endpoint for a DNS resolver. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar etag: ETag of the inbound endpoint. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param ip_configurations: IP configurations for the inbound endpoint. + :type ip_configurations: list[~azure.mgmt.dnsresolver.models.IpConfiguration] + :ivar provisioning_state: The current provisioning state of the inbound endpoint. This is a + read-only property and any attempt to set this value will be ignored. Possible values include: + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + :ivar resource_guid: The resourceGuid property of the inbound endpoint resource. + :vartype resource_guid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IpConfiguration]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundEndpoint, self).__init__(**kwargs) + self.etag = None + self.system_data = None + self.ip_configurations = kwargs.get('ip_configurations', None) + self.provisioning_state = None + self.resource_guid = None + + +class InboundEndpointListResult(msrest.serialization.Model): + """The response to an enumeration operation on inbound endpoints for a DNS resolver. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the inbound endpoints for a DNS resolver. + :type value: list[~azure.mgmt.dnsresolver.models.InboundEndpoint] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InboundEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundEndpointListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class InboundEndpointPatch(msrest.serialization.Model): + """Describes an inbound endpoint for a DNS resolver for PATCH operation. + + :param tags: A set of tags. Tags for inbound endpoint. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundEndpointPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class IpConfiguration(msrest.serialization.Model): + """IP configuration. + + :param subnet: The reference to the subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.dnsresolver.models.SubResource + :param private_ip_address: Private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: Private IP address allocation method. Possible values + include: "Static", "Dynamic". Default value: "Dynamic". + :type private_ip_allocation_method: str or ~azure.mgmt.dnsresolver.models.IpAllocationMethod + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'privateIpAllocationMethod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IpConfiguration, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', "Dynamic") + + +class OutboundEndpoint(TrackedResource): + """Describes an outbound endpoint for a DNS resolver. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar etag: ETag of the outbound endpoint. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param subnet: The reference to the subnet used for the outbound endpoint. + :type subnet: ~azure.mgmt.dnsresolver.models.SubResource + :ivar provisioning_state: The current provisioning state of the outbound endpoint. This is a + read-only property and any attempt to set this value will be ignored. Possible values include: + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + :ivar resource_guid: The resourceGuid property of the outbound endpoint resource. + :vartype resource_guid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEndpoint, self).__init__(**kwargs) + self.etag = None + self.system_data = None + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = None + self.resource_guid = None + + +class OutboundEndpointListResult(msrest.serialization.Model): + """The response to an enumeration operation on outbound endpoints for a DNS resolver. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the outbound endpoints for a DNS resolver. + :type value: list[~azure.mgmt.dnsresolver.models.OutboundEndpoint] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEndpointListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class OutboundEndpointPatch(msrest.serialization.Model): + """Describes an outbound endpoint for a DNS resolver for PATCH operation. + + :param tags: A set of tags. Tags for outbound endpoint. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEndpointPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', 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 SubResource(msrest.serialization.Model): + """Reference to another ARM resource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class SubResourceListResult(msrest.serialization.Model): + """The response to an enumeration operation on sub-resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the sub-resources. + :type value: list[~azure.mgmt.dnsresolver.models.SubResource] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SubResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.dnsresolver.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.dnsresolver.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TargetDnsServer(msrest.serialization.Model): + """Describes a server to forward the DNS queries to. + + :param ip_address: DNS server IP address. + :type ip_address: str + :param port: DNS server port. + :type port: int + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(TargetDnsServer, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.port = kwargs.get('port', 53) + + +class VirtualNetworkDnsForwardingRuleset(msrest.serialization.Model): + """Reference to DNS forwarding ruleset and associated virtual network link. + + :param id: DNS Forwarding Ruleset Resource ID. + :type id: str + :param virtual_network_link: The reference to the virtual network link. + :type virtual_network_link: ~azure.mgmt.dnsresolver.models.SubResource + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'virtual_network_link': {'key': 'properties.virtualNetworkLink', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkDnsForwardingRuleset, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.virtual_network_link = kwargs.get('virtual_network_link', None) + + +class VirtualNetworkDnsForwardingRulesetListResult(msrest.serialization.Model): + """The response to an enumeration operation on Virtual Network DNS Forwarding Ruleset. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the Virtual Network DNS Forwarding Ruleset. + :type value: list[~azure.mgmt.dnsresolver.models.VirtualNetworkDnsForwardingRuleset] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkDnsForwardingRuleset]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkDnsForwardingRulesetListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class VirtualNetworkLink(Resource): + """Describes a virtual network link. + + 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 etag: ETag of the virtual network link. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param virtual_network: The reference to the virtual network. This cannot be changed after + creation. + :type virtual_network: ~azure.mgmt.dnsresolver.models.SubResource + :param metadata: Metadata attached to the virtual network link. + :type metadata: dict[str, str] + :ivar provisioning_state: The current provisioning state of the virtual network link. This is a + read-only property and any attempt to set this value will be ignored. Possible values include: + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'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'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'SubResource'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkLink, self).__init__(**kwargs) + self.etag = None + self.system_data = None + self.virtual_network = kwargs.get('virtual_network', None) + self.metadata = kwargs.get('metadata', None) + self.provisioning_state = None + + +class VirtualNetworkLinkListResult(msrest.serialization.Model): + """The response to an enumeration operation on virtual network links. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the virtual network links. + :type value: list[~azure.mgmt.dnsresolver.models.VirtualNetworkLink] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkLinkListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class VirtualNetworkLinkPatch(msrest.serialization.Model): + """Describes a virtual network link for PATCH operation. + + :param metadata: Metadata attached to the virtual network link. + :type metadata: dict[str, str] + """ + + _attribute_map = { + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkLinkPatch, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/_models_py3.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/_models_py3.py new file mode 100644 index 00000000000..0e4d48d19a0 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/models/_models_py3.py @@ -0,0 +1,1145 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +import msrest.serialization + +from ._dns_resolver_management_client_enums import * + + +class CloudErrorBody(msrest.serialization.Model): + """The body of an error message. + + :param code: The error code. + :type code: str + :param message: A description of what caused the error. + :type message: str + :param target: The target resource of the error message. + :type target: str + :param details: Extra error information. + :type details: list[~azure.mgmt.dnsresolver.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class 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 TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class DnsForwardingRuleset(TrackedResource): + """Describes a DNS forwarding ruleset. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar etag: ETag of the DNS forwarding ruleset. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param dns_resolver_outbound_endpoints: The reference to the DNS resolver outbound endpoints + that are used to route DNS queries matching the forwarding rules in the ruleset to the target + DNS servers. + :type dns_resolver_outbound_endpoints: list[~azure.mgmt.dnsresolver.models.SubResource] + :ivar provisioning_state: The current provisioning state of the DNS forwarding ruleset. This is + a read-only property and any attempt to set this value will be ignored. Possible values + include: "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + :ivar resource_guid: The resourceGuid for the DNS forwarding ruleset. + :vartype resource_guid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'dns_resolver_outbound_endpoints': {'key': 'properties.dnsResolverOutboundEndpoints', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + dns_resolver_outbound_endpoints: Optional[List["SubResource"]] = None, + **kwargs + ): + super(DnsForwardingRuleset, self).__init__(tags=tags, location=location, **kwargs) + self.etag = None + self.system_data = None + self.dns_resolver_outbound_endpoints = dns_resolver_outbound_endpoints + self.provisioning_state = None + self.resource_guid = None + + +class DnsForwardingRulesetListResult(msrest.serialization.Model): + """The response to an enumeration operation on DNS forwarding rulesets. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the DNS forwarding rulesets. + :type value: list[~azure.mgmt.dnsresolver.models.DnsForwardingRuleset] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DnsForwardingRuleset]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["DnsForwardingRuleset"]] = None, + **kwargs + ): + super(DnsForwardingRulesetListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DnsForwardingRulesetPatch(msrest.serialization.Model): + """Describes a DNS forwarding ruleset PATCH operation. + + :param tags: A set of tags. Tags for DNS Resolver. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(DnsForwardingRulesetPatch, self).__init__(**kwargs) + self.tags = tags + + +class DnsResolver(TrackedResource): + """Describes a DNS resolver. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar etag: ETag of the DNS resolver. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param virtual_network: The reference to the virtual network. This cannot be changed after + creation. + :type virtual_network: ~azure.mgmt.dnsresolver.models.SubResource + :ivar dns_resolver_state: The current status of the DNS resolver. This is a read-only property + and any attempt to set this value will be ignored. Possible values include: "Connected", + "Disconnected". + :vartype dns_resolver_state: str or ~azure.mgmt.dnsresolver.models.DnsResolverState + :ivar provisioning_state: The current provisioning state of the DNS resolver. This is a read- + only property and any attempt to set this value will be ignored. Possible values include: + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + :ivar resource_guid: The resourceGuid property of the DNS resolver resource. + :vartype resource_guid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, + 'dns_resolver_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'SubResource'}, + 'dns_resolver_state': {'key': 'properties.dnsResolverState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + virtual_network: Optional["SubResource"] = None, + **kwargs + ): + super(DnsResolver, self).__init__(tags=tags, location=location, **kwargs) + self.etag = None + self.system_data = None + self.virtual_network = virtual_network + self.dns_resolver_state = None + self.provisioning_state = None + self.resource_guid = None + + +class DnsResolverListResult(msrest.serialization.Model): + """The response to an enumeration operation on DNS resolvers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the DNS resolvers. + :type value: list[~azure.mgmt.dnsresolver.models.DnsResolver] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DnsResolver]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["DnsResolver"]] = None, + **kwargs + ): + super(DnsResolverListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DnsResolverPatch(msrest.serialization.Model): + """Describes a DNS resolver for PATCH operation. + + :param tags: A set of tags. Tags for DNS Resolver. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(DnsResolverPatch, self).__init__(**kwargs) + self.tags = tags + + +class ForwardingRule(Resource): + """Describes a forwarding rule within a DNS forwarding ruleset. + + 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 etag: ETag of the forwarding rule. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param domain_name: The domain name for the forwarding rule. + :type domain_name: str + :param target_dns_servers: DNS servers to forward the DNS query to. + :type target_dns_servers: list[~azure.mgmt.dnsresolver.models.TargetDnsServer] + :param metadata: Metadata attached to the forwarding rule. + :type metadata: dict[str, str] + :param forwarding_rule_state: The state of forwarding rule. Possible values include: "Enabled", + "Disabled". + :type forwarding_rule_state: str or ~azure.mgmt.dnsresolver.models.ForwardingRuleState + :ivar provisioning_state: The current provisioning state of the forwarding rule. This is a + read-only property and any attempt to set this value will be ignored. Possible values include: + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'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'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'target_dns_servers': {'key': 'properties.targetDnsServers', 'type': '[TargetDnsServer]'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'forwarding_rule_state': {'key': 'properties.forwardingRuleState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + target_dns_servers: Optional[List["TargetDnsServer"]] = None, + metadata: Optional[Dict[str, str]] = None, + forwarding_rule_state: Optional[Union[str, "ForwardingRuleState"]] = None, + **kwargs + ): + super(ForwardingRule, self).__init__(**kwargs) + self.etag = None + self.system_data = None + self.domain_name = domain_name + self.target_dns_servers = target_dns_servers + self.metadata = metadata + self.forwarding_rule_state = forwarding_rule_state + self.provisioning_state = None + + +class ForwardingRuleListResult(msrest.serialization.Model): + """The response to an enumeration operation on forwarding rules within a DNS forwarding ruleset. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the forwarding rules. + :type value: list[~azure.mgmt.dnsresolver.models.ForwardingRule] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ForwardingRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ForwardingRule"]] = None, + **kwargs + ): + super(ForwardingRuleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ForwardingRulePatch(msrest.serialization.Model): + """Describes a forwarding rule for PATCH operation. + + :param target_dns_servers: DNS servers to forward the DNS query to. + :type target_dns_servers: list[~azure.mgmt.dnsresolver.models.TargetDnsServer] + :param metadata: Metadata attached to the forwarding rule. + :type metadata: dict[str, str] + :param forwarding_rule_state: The state of forwarding rule. Possible values include: "Enabled", + "Disabled". + :type forwarding_rule_state: str or ~azure.mgmt.dnsresolver.models.ForwardingRuleState + """ + + _attribute_map = { + 'target_dns_servers': {'key': 'properties.targetDnsServers', 'type': '[TargetDnsServer]'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'forwarding_rule_state': {'key': 'properties.forwardingRuleState', 'type': 'str'}, + } + + def __init__( + self, + *, + target_dns_servers: Optional[List["TargetDnsServer"]] = None, + metadata: Optional[Dict[str, str]] = None, + forwarding_rule_state: Optional[Union[str, "ForwardingRuleState"]] = None, + **kwargs + ): + super(ForwardingRulePatch, self).__init__(**kwargs) + self.target_dns_servers = target_dns_servers + self.metadata = metadata + self.forwarding_rule_state = forwarding_rule_state + + +class InboundEndpoint(TrackedResource): + """Describes an inbound endpoint for a DNS resolver. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar etag: ETag of the inbound endpoint. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param ip_configurations: IP configurations for the inbound endpoint. + :type ip_configurations: list[~azure.mgmt.dnsresolver.models.IpConfiguration] + :ivar provisioning_state: The current provisioning state of the inbound endpoint. This is a + read-only property and any attempt to set this value will be ignored. Possible values include: + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + :ivar resource_guid: The resourceGuid property of the inbound endpoint resource. + :vartype resource_guid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IpConfiguration]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + ip_configurations: Optional[List["IpConfiguration"]] = None, + **kwargs + ): + super(InboundEndpoint, self).__init__(tags=tags, location=location, **kwargs) + self.etag = None + self.system_data = None + self.ip_configurations = ip_configurations + self.provisioning_state = None + self.resource_guid = None + + +class InboundEndpointListResult(msrest.serialization.Model): + """The response to an enumeration operation on inbound endpoints for a DNS resolver. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the inbound endpoints for a DNS resolver. + :type value: list[~azure.mgmt.dnsresolver.models.InboundEndpoint] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InboundEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["InboundEndpoint"]] = None, + **kwargs + ): + super(InboundEndpointListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class InboundEndpointPatch(msrest.serialization.Model): + """Describes an inbound endpoint for a DNS resolver for PATCH operation. + + :param tags: A set of tags. Tags for inbound endpoint. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(InboundEndpointPatch, self).__init__(**kwargs) + self.tags = tags + + +class IpConfiguration(msrest.serialization.Model): + """IP configuration. + + :param subnet: The reference to the subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.dnsresolver.models.SubResource + :param private_ip_address: Private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: Private IP address allocation method. Possible values + include: "Static", "Dynamic". Default value: "Dynamic". + :type private_ip_allocation_method: str or ~azure.mgmt.dnsresolver.models.IpAllocationMethod + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'privateIpAllocationMethod', 'type': 'str'}, + } + + def __init__( + self, + *, + subnet: Optional["SubResource"] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "IpAllocationMethod"]] = "Dynamic", + **kwargs + ): + super(IpConfiguration, self).__init__(**kwargs) + self.subnet = subnet + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + + +class OutboundEndpoint(TrackedResource): + """Describes an outbound endpoint for a DNS resolver. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar etag: ETag of the outbound endpoint. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param subnet: The reference to the subnet used for the outbound endpoint. + :type subnet: ~azure.mgmt.dnsresolver.models.SubResource + :ivar provisioning_state: The current provisioning state of the outbound endpoint. This is a + read-only property and any attempt to set this value will be ignored. Possible values include: + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + :ivar resource_guid: The resourceGuid property of the outbound endpoint resource. + :vartype resource_guid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + subnet: Optional["SubResource"] = None, + **kwargs + ): + super(OutboundEndpoint, self).__init__(tags=tags, location=location, **kwargs) + self.etag = None + self.system_data = None + self.subnet = subnet + self.provisioning_state = None + self.resource_guid = None + + +class OutboundEndpointListResult(msrest.serialization.Model): + """The response to an enumeration operation on outbound endpoints for a DNS resolver. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the outbound endpoints for a DNS resolver. + :type value: list[~azure.mgmt.dnsresolver.models.OutboundEndpoint] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["OutboundEndpoint"]] = None, + **kwargs + ): + super(OutboundEndpointListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class OutboundEndpointPatch(msrest.serialization.Model): + """Describes an outbound endpoint for a DNS resolver for PATCH operation. + + :param tags: A set of tags. Tags for outbound endpoint. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(OutboundEndpointPatch, self).__init__(**kwargs) + self.tags = tags + + +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 SubResource(msrest.serialization.Model): + """Reference to another ARM resource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = id + + +class SubResourceListResult(msrest.serialization.Model): + """The response to an enumeration operation on sub-resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the sub-resources. + :type value: list[~azure.mgmt.dnsresolver.models.SubResource] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SubResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SubResource"]] = None, + **kwargs + ): + super(SubResourceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.dnsresolver.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.dnsresolver.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TargetDnsServer(msrest.serialization.Model): + """Describes a server to forward the DNS queries to. + + :param ip_address: DNS server IP address. + :type ip_address: str + :param port: DNS server port. + :type port: int + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = 53, + **kwargs + ): + super(TargetDnsServer, self).__init__(**kwargs) + self.ip_address = ip_address + self.port = port + + +class VirtualNetworkDnsForwardingRuleset(msrest.serialization.Model): + """Reference to DNS forwarding ruleset and associated virtual network link. + + :param id: DNS Forwarding Ruleset Resource ID. + :type id: str + :param virtual_network_link: The reference to the virtual network link. + :type virtual_network_link: ~azure.mgmt.dnsresolver.models.SubResource + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'virtual_network_link': {'key': 'properties.virtualNetworkLink', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + virtual_network_link: Optional["SubResource"] = None, + **kwargs + ): + super(VirtualNetworkDnsForwardingRuleset, self).__init__(**kwargs) + self.id = id + self.virtual_network_link = virtual_network_link + + +class VirtualNetworkDnsForwardingRulesetListResult(msrest.serialization.Model): + """The response to an enumeration operation on Virtual Network DNS Forwarding Ruleset. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the Virtual Network DNS Forwarding Ruleset. + :type value: list[~azure.mgmt.dnsresolver.models.VirtualNetworkDnsForwardingRuleset] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkDnsForwardingRuleset]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualNetworkDnsForwardingRuleset"]] = None, + **kwargs + ): + super(VirtualNetworkDnsForwardingRulesetListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class VirtualNetworkLink(Resource): + """Describes a virtual network link. + + 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 etag: ETag of the virtual network link. + :vartype etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.dnsresolver.models.SystemData + :param virtual_network: The reference to the virtual network. This cannot be changed after + creation. + :type virtual_network: ~azure.mgmt.dnsresolver.models.SubResource + :param metadata: Metadata attached to the virtual network link. + :type metadata: dict[str, str] + :ivar provisioning_state: The current provisioning state of the virtual network link. This is a + read-only property and any attempt to set this value will be ignored. Possible values include: + "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.dnsresolver.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'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'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'SubResource'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + virtual_network: Optional["SubResource"] = None, + metadata: Optional[Dict[str, str]] = None, + **kwargs + ): + super(VirtualNetworkLink, self).__init__(**kwargs) + self.etag = None + self.system_data = None + self.virtual_network = virtual_network + self.metadata = metadata + self.provisioning_state = None + + +class VirtualNetworkLinkListResult(msrest.serialization.Model): + """The response to an enumeration operation on virtual network links. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Enumeration of the virtual network links. + :type value: list[~azure.mgmt.dnsresolver.models.VirtualNetworkLink] + :ivar next_link: The continuation token for the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualNetworkLink"]] = None, + **kwargs + ): + super(VirtualNetworkLinkListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class VirtualNetworkLinkPatch(msrest.serialization.Model): + """Describes a virtual network link for PATCH operation. + + :param metadata: Metadata attached to the virtual network link. + :type metadata: dict[str, str] + """ + + _attribute_map = { + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + **kwargs + ): + super(VirtualNetworkLinkPatch, self).__init__(**kwargs) + self.metadata = metadata diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/__init__.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/__init__.py new file mode 100644 index 00000000000..6656675bef0 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/__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 ._dns_resolvers_operations import DnsResolversOperations +from ._inbound_endpoints_operations import InboundEndpointsOperations +from ._outbound_endpoints_operations import OutboundEndpointsOperations +from ._dns_forwarding_rulesets_operations import DnsForwardingRulesetsOperations +from ._forwarding_rules_operations import ForwardingRulesOperations +from ._virtual_network_links_operations import VirtualNetworkLinksOperations + +__all__ = [ + 'DnsResolversOperations', + 'InboundEndpointsOperations', + 'OutboundEndpointsOperations', + 'DnsForwardingRulesetsOperations', + 'ForwardingRulesOperations', + 'VirtualNetworkLinksOperations', +] diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_dns_forwarding_rulesets_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_dns_forwarding_rulesets_operations.py new file mode 100644 index 00000000000..a0e0dfd48e1 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_dns_forwarding_rulesets_operations.py @@ -0,0 +1,743 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DnsForwardingRulesetsOperations(object): + """DnsForwardingRulesetsOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + parameters, # type: "models.DnsForwardingRuleset" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.DnsForwardingRuleset"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DnsForwardingRuleset"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.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), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'DnsForwardingRuleset') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DnsForwardingRuleset', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DnsForwardingRuleset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + parameters, # type: "models.DnsForwardingRuleset" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.DnsForwardingRuleset"] + """Creates or updates a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.DnsForwardingRuleset + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DnsForwardingRuleset or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dnsresolver.models.DnsForwardingRuleset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsForwardingRuleset"] + 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( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DnsForwardingRuleset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + parameters, # type: "models.DnsForwardingRulesetPatch" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.DnsForwardingRuleset"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DnsForwardingRuleset"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.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), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'DnsForwardingRulesetPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DnsForwardingRuleset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + parameters, # type: "models.DnsForwardingRulesetPatch" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.DnsForwardingRuleset"] + """Updates a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.DnsForwardingRulesetPatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DnsForwardingRuleset or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dnsresolver.models.DnsForwardingRuleset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsForwardingRuleset"] + 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( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + parameters=parameters, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DnsForwardingRuleset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a DNS forwarding ruleset. WARNING: This operation cannot be undone. All forwarding + rules within the ruleset will be deleted. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DnsForwardingRuleset" + """Gets a DNS forwarding ruleset properties. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DnsForwardingRuleset, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.DnsForwardingRuleset + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsForwardingRuleset"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DnsForwardingRuleset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DnsForwardingRulesetListResult"] + """Lists DNS forwarding rulesets within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DnsForwardingRulesetListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dnsresolver.models.DnsForwardingRulesetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsForwardingRulesetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DnsForwardingRulesetListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets'} # type: ignore + + def list( + self, + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DnsForwardingRulesetListResult"] + """Lists DNS forwarding rulesets in all resource groups of a subscription. + + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DnsForwardingRulesetListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dnsresolver.models.DnsForwardingRulesetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsForwardingRulesetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DnsForwardingRulesetListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnsForwardingRulesets'} # type: ignore + + def list_by_virtual_network( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualNetworkDnsForwardingRulesetListResult"] + """Lists DNS forwarding ruleset resource IDs attached to a virtual network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkDnsForwardingRulesetListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dnsresolver.models.VirtualNetworkDnsForwardingRulesetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkDnsForwardingRulesetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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_virtual_network.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), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkDnsForwardingRulesetListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listDnsForwardingRulesets'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_dns_resolvers_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_dns_resolvers_operations.py new file mode 100644 index 00000000000..f0ace704cd0 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_dns_resolvers_operations.py @@ -0,0 +1,742 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DnsResolversOperations(object): + """DnsResolversOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + parameters, # type: "models.DnsResolver" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.DnsResolver"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DnsResolver"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'DnsResolver') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DnsResolver', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DnsResolver', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + parameters, # type: "models.DnsResolver" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.DnsResolver"] + """Creates or updates a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.DnsResolver + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DnsResolver or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dnsresolver.models.DnsResolver] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsResolver"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DnsResolver', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + parameters, # type: "models.DnsResolverPatch" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.DnsResolver"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DnsResolver"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'DnsResolverPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DnsResolver', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + parameters, # type: "models.DnsResolverPatch" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.DnsResolver"] + """Updates a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.DnsResolverPatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DnsResolver or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dnsresolver.models.DnsResolver] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsResolver"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + parameters=parameters, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DnsResolver', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a DNS resolver. WARNING: This operation cannot be undone. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DnsResolver" + """Gets properties of a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DnsResolver, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.DnsResolver + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsResolver"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DnsResolver', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DnsResolverListResult"] + """Lists DNS resolvers within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DnsResolverListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dnsresolver.models.DnsResolverListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsResolverListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DnsResolverListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers'} # type: ignore + + def list( + self, + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DnsResolverListResult"] + """Lists DNS resolvers in all resource groups of a subscription. + + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DnsResolverListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dnsresolver.models.DnsResolverListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsResolverListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DnsResolverListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnsResolvers'} # type: ignore + + def list_by_virtual_network( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.SubResourceListResult"] + """Lists DNS resolver resource IDs linked to a virtual network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SubResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dnsresolver.models.SubResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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_virtual_network.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), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SubResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listDnsResolvers'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_forwarding_rules_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_forwarding_rules_operations.py new file mode 100644 index 00000000000..04d89161cf1 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_forwarding_rules_operations.py @@ -0,0 +1,424 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ForwardingRulesOperations(object): + """ForwardingRulesOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create_or_update( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + forwarding_rule_name, # type: str + parameters, # type: "models.ForwardingRule" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ForwardingRule" + """Creates or updates a forwarding rule in a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param forwarding_rule_name: The name of the forwarding rule. + :type forwarding_rule_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.ForwardingRule + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ForwardingRule, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ForwardingRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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 = { + '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), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'forwardingRuleName': self._serialize.url("forwarding_rule_name", forwarding_rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'ForwardingRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ForwardingRule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ForwardingRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + forwarding_rule_name, # type: str + parameters, # type: "models.ForwardingRulePatch" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ForwardingRule" + """Updates a forwarding rule in a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param forwarding_rule_name: The name of the forwarding rule. + :type forwarding_rule_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.ForwardingRulePatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ForwardingRule, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ForwardingRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'forwardingRuleName': self._serialize.url("forwarding_rule_name", forwarding_rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'ForwardingRulePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ForwardingRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + forwarding_rule_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a forwarding rule in a DNS forwarding ruleset. WARNING: This operation cannot be + undone. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param forwarding_rule_name: The name of the forwarding rule. + :type forwarding_rule_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: 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-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'forwardingRuleName': self._serialize.url("forwarding_rule_name", forwarding_rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + forwarding_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ForwardingRule" + """Gets properties of a forwarding rule in a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param forwarding_rule_name: The name of the forwarding rule. + :type forwarding_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ForwardingRule, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ForwardingRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'forwardingRuleName': self._serialize.url("forwarding_rule_name", forwarding_rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ForwardingRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ForwardingRuleListResult"] + """Lists forwarding rules in a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ForwardingRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dnsresolver.models.ForwardingRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ForwardingRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ForwardingRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_inbound_endpoints_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_inbound_endpoints_operations.py new file mode 100644 index 00000000000..9c7cbe4d8c6 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_inbound_endpoints_operations.py @@ -0,0 +1,617 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class InboundEndpointsOperations(object): + """InboundEndpointsOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + inbound_endpoint_name, # type: str + parameters, # type: "models.InboundEndpoint" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.InboundEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.InboundEndpoint"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'InboundEndpoint') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('InboundEndpoint', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('InboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + inbound_endpoint_name, # type: str + parameters, # type: "models.InboundEndpoint" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.InboundEndpoint"] + """Creates or updates an inbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param inbound_endpoint_name: The name of the inbound endpoint for the DNS resolver. + :type inbound_endpoint_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.InboundEndpoint + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either InboundEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dnsresolver.models.InboundEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundEndpoint"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + inbound_endpoint_name=inbound_endpoint_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('InboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + inbound_endpoint_name, # type: str + parameters, # type: "models.InboundEndpointPatch" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.InboundEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.InboundEndpoint"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'InboundEndpointPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('InboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + inbound_endpoint_name, # type: str + parameters, # type: "models.InboundEndpointPatch" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.InboundEndpoint"] + """Updates an inbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param inbound_endpoint_name: The name of the inbound endpoint for the DNS resolver. + :type inbound_endpoint_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.InboundEndpointPatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either InboundEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dnsresolver.models.InboundEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundEndpoint"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + inbound_endpoint_name=inbound_endpoint_name, + parameters=parameters, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('InboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + inbound_endpoint_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + inbound_endpoint_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an inbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param inbound_endpoint_name: The name of the inbound endpoint for the DNS resolver. + :type inbound_endpoint_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + inbound_endpoint_name=inbound_endpoint_name, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + inbound_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.InboundEndpoint" + """Gets properties of an inbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param inbound_endpoint_name: The name of the inbound endpoint for the DNS resolver. + :type inbound_endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: InboundEndpoint, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.InboundEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'inboundEndpointName': self._serialize.url("inbound_endpoint_name", inbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('InboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints/{inboundEndpointName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.InboundEndpointListResult"] + """Lists inbound endpoints for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InboundEndpointListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dnsresolver.models.InboundEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundEndpointListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('InboundEndpointListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/inboundEndpoints'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_outbound_endpoints_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_outbound_endpoints_operations.py new file mode 100644 index 00000000000..436125ac1c6 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_outbound_endpoints_operations.py @@ -0,0 +1,617 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OutboundEndpointsOperations(object): + """OutboundEndpointsOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + outbound_endpoint_name, # type: str + parameters, # type: "models.OutboundEndpoint" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.OutboundEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OutboundEndpoint"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'OutboundEndpoint') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OutboundEndpoint', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('OutboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + outbound_endpoint_name, # type: str + parameters, # type: "models.OutboundEndpoint" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.OutboundEndpoint"] + """Creates or updates an outbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param outbound_endpoint_name: The name of the outbound endpoint for the DNS resolver. + :type outbound_endpoint_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.OutboundEndpoint + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either OutboundEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dnsresolver.models.OutboundEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundEndpoint"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + outbound_endpoint_name=outbound_endpoint_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OutboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + outbound_endpoint_name, # type: str + parameters, # type: "models.OutboundEndpointPatch" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.OutboundEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OutboundEndpoint"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.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), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'OutboundEndpointPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OutboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + outbound_endpoint_name, # type: str + parameters, # type: "models.OutboundEndpointPatch" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.OutboundEndpoint"] + """Updates an outbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param outbound_endpoint_name: The name of the outbound endpoint for the DNS resolver. + :type outbound_endpoint_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.OutboundEndpointPatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either OutboundEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dnsresolver.models.OutboundEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundEndpoint"] + 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( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + outbound_endpoint_name=outbound_endpoint_name, + parameters=parameters, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OutboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + outbound_endpoint_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + outbound_endpoint_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an outbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param outbound_endpoint_name: The name of the outbound endpoint for the DNS resolver. + :type outbound_endpoint_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + dns_resolver_name=dns_resolver_name, + outbound_endpoint_name=outbound_endpoint_name, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + outbound_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OutboundEndpoint" + """Gets properties of an outbound endpoint for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param outbound_endpoint_name: The name of the outbound endpoint for the DNS resolver. + :type outbound_endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OutboundEndpoint, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.OutboundEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + 'outboundEndpointName': self._serialize.url("outbound_endpoint_name", outbound_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OutboundEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints/{outboundEndpointName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + dns_resolver_name, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OutboundEndpointListResult"] + """Lists outbound endpoints for a DNS resolver. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_resolver_name: The name of the DNS resolver. + :type dns_resolver_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEndpointListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dnsresolver.models.OutboundEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundEndpointListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsResolverName': self._serialize.url("dns_resolver_name", dns_resolver_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OutboundEndpointListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName}/outboundEndpoints'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_virtual_network_links_operations.py b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_virtual_network_links_operations.py new file mode 100644 index 00000000000..6b41971e804 --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/operations/_virtual_network_links_operations.py @@ -0,0 +1,618 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworkLinksOperations(object): + """VirtualNetworkLinksOperations 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.dnsresolver.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + virtual_network_link_name, # type: str + parameters, # type: "models.VirtualNetworkLink" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.VirtualNetworkLink"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkLink"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.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), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + 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(parameters, 'VirtualNetworkLink') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkLink', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + virtual_network_link_name, # type: str + parameters, # type: "models.VirtualNetworkLink" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualNetworkLink"] + """Creates or updates a virtual network link to a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param virtual_network_link_name: The name of the virtual network link. + :type virtual_network_link_name: str + :param parameters: Parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.dnsresolver.models.VirtualNetworkLink + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating + an existing resource. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualNetworkLink or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dnsresolver.models.VirtualNetworkLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkLink"] + 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( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + virtual_network_link_name=virtual_network_link_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + virtual_network_link_name, # type: str + parameters, # type: "models.VirtualNetworkLinkPatch" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.VirtualNetworkLink"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkLink"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.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), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'VirtualNetworkLinkPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + virtual_network_link_name, # type: str + parameters, # type: "models.VirtualNetworkLinkPatch" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualNetworkLink"] + """Updates a virtual network link to a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param virtual_network_link_name: The name of the virtual network link. + :type virtual_network_link_name: str + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dnsresolver.models.VirtualNetworkLinkPatch + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualNetworkLink or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dnsresolver.models.VirtualNetworkLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkLink"] + 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( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + virtual_network_link_name=virtual_network_link_name, + parameters=parameters, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + virtual_network_link_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + virtual_network_link_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a virtual network link to a DNS forwarding ruleset. WARNING: This operation cannot be + undone. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param virtual_network_link_name: The name of the virtual network link. + :type virtual_network_link_name: str + :param if_match: ETag of the resource. Omit this value to always overwrite the current + resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + changes. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + dns_forwarding_ruleset_name=dns_forwarding_ruleset_name, + virtual_network_link_name=virtual_network_link_name, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + virtual_network_link_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualNetworkLink" + """Gets properties of a virtual network link to a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param virtual_network_link_name: The name of the virtual network link. + :type virtual_network_link_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkLink, or the result of cls(response) + :rtype: ~azure.mgmt.dnsresolver.models.VirtualNetworkLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkLink"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + 'virtualNetworkLinkName': self._serialize.url("virtual_network_link_name", virtual_network_link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetworkLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks/{virtualNetworkLinkName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + dns_forwarding_ruleset_name, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualNetworkLinkListResult"] + """Lists virtual network links to a DNS forwarding ruleset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. + :type dns_forwarding_ruleset_name: str + :param top: The maximum number of results to return. If not specified, returns up to 100 + results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkLinkListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dnsresolver.models.VirtualNetworkLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkLinkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-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), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'dnsForwardingRulesetName': self._serialize.url("dns_forwarding_ruleset_name", dns_forwarding_ruleset_name, 'str'), + } + url = self._client.format_url(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 top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkLinkListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/virtualNetworkLinks'} # type: ignore diff --git a/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/py.typed b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/dns-resolver/azext_dnsresolver/vendored_sdks/dnsresolver/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/dns-resolver/setup.cfg b/src/dns-resolver/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/dns-resolver/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/dns-resolver/setup.py b/src/dns-resolver/setup.py new file mode 100644 index 00000000000..13ffa25585b --- /dev/null +++ b/src/dns-resolver/setup.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +# HISTORY.rst entry. +VERSION = '0.1.0' +try: + from azext_dnsresolver.manual.version import VERSION +except ImportError: + pass + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +try: + from azext_dnsresolver.manual.dependency import DEPENDENCIES +except ImportError: + pass + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='dns_resolver', + version=VERSION, + description='Microsoft Azure Command-Line Tools DnsResolverManagementClient Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/main/src/dns-resolver', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_dnsresolver': ['azext_metadata.json']}, +) diff --git a/src/index.json b/src/index.json index 23af70702ed..d9bbbfd16f9 100644 --- a/src/index.json +++ b/src/index.json @@ -5108,6 +5108,92 @@ "version": "0.5.64" }, "sha256Digest": "377db46a822434677059bae8f8584e408d42ba951a7e8b688e50579236864faf" + }, + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-0.5.65-py2.py3-none-any.whl", + "filename": "aks_preview-0.5.65-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.32.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.65" + }, + "sha256Digest": "df53989fd97f37b5feb6bd54dca9c11308cd8ac6c77e012efccfb4c0111c2f18" + }, + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-0.5.66-py2.py3-none-any.whl", + "filename": "aks_preview-0.5.66-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.32.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.66" + }, + "sha256Digest": "82026c5aafd8f0c7f5e72524e708a4ed5c6485b574686d0cdded1104f20a82b3" } ], "alertsmanagement": [ @@ -6636,6 +6722,64 @@ } ], "arcdata": [ + { + "downloadUrl": "https://azurearcdatacli.blob.core.windows.net/cli-extensions/arcdata-1.4.0-py2.py3-none-any.whl", + "filename": "arcdata-1.4.0-py2.py3-none-any.whl", + "metadata": { + "azext.isExperimental": false, + "azext.minCliCoreVersion": "2.3.1", + "classifiers": [ + "Development Status :: 1 - Beta", + "Intended Audience :: Developers", + "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": "dpgswdist@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://docs.microsoft.com/en-us/azure/azure-arc/data/" + } + } + }, + "extras": [], + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "license_file": "LICENSE", + "metadata_version": "2.0", + "name": "arcdata", + "run_requires": [ + { + "requires": [ + "colorama (==0.4.4)", + "jinja2 (==3.0.3)", + "jsonpatch (==1.24)", + "jsonpath-ng (==1.4.3)", + "jsonschema (==3.2.0)", + "kubernetes (==12.0.1)", + "ndjson (==0.3.1)", + "pem (==21.2.0)", + "pydash (==4.8.0)" + ] + } + ], + "summary": "Tools for managing ArcData.", + "version": "1.4.0" + }, + "sha256Digest": "26e67d2d3920902c12330a53f831d7916a1461926c0efd3b7929416bd04c78b0" + }, { "downloadUrl": "https://azurearcdatacli.blob.core.windows.net/cli-extensions/arcdata-1.3.1-py2.py3-none-any.whl", "filename": "arcdata-1.3.1-py2.py3-none-any.whl", @@ -9503,6 +9647,77 @@ "version": "0.14.0" }, "sha256Digest": "56e07939e0f60412c8dce20a278127be4768a4cd8c487e5201396428e1b2f86f" + }, + { + "downloadUrl": "https://github.com/Azure/azure-iot-cli-extension/releases/download/v0.14.1/azure_iot-0.14.1-py3-none-any.whl", + "filename": "azure_iot-0.14.1-py3-none-any.whl", + "metadata": { + "azext.minCliCoreVersion": "2.24.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "iotupx@microsoft.com", + "name": "Microsoft", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/azure/azure-iot-cli-extension" + } + } + }, + "extras": [ + "uamqp" + ], + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "azure-iot", + "requires_python": ">=3.6,<4", + "run_requires": [ + { + "requires": [ + "azure-iot-device (~=2.5)", + "jsonschema (~=3.2.0)", + "msrestazure (<2.0.0,>=0.6.3)", + "packaging", + "tqdm (~=4.62)" + ] + }, + { + "extra": "uamqp", + "requires": [ + "uamqp (~=1.2)" + ] + }, + { + "environment": "python_version < \"3.8\"", + "requires": [ + "importlib-metadata" + ] + } + ], + "summary": "The Azure IoT extension for Azure CLI.", + "version": "0.14.1" + }, + "sha256Digest": "9138b2610ac1ad775d4012e532cfa273a2d56dc2a649aa71d838f3c26d74b77d" } ], "azurestackhci": [ @@ -12955,6 +13170,60 @@ "version": "0.3.2" }, "sha256Digest": "581e704f223937b0e7fb99c0323768a04c956ade8b06cb7140454c06b85f254b" + }, + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.3-py2.py3-none-any.whl", + "filename": "containerapp-0.3.3-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.maxCliCoreVersion": "2.36.0", + "azext.minCliCoreVersion": "2.15.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", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "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" + } + } + }, + "extras": [], + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "containerapp", + "run_requires": [ + { + "requires": [ + "azure-cli-core" + ] + } + ], + "summary": "Microsoft Azure Command-Line Tools Containerapp Extension", + "version": "0.3.3" + }, + "sha256Digest": "63eb3289319ee4151d916329b368354085074b7b3ea21ed1d16d83a29cbe16b7" } ], "cosmosdb-preview": [ @@ -17014,6 +17283,51 @@ "sha256Digest": "237f362908d8deda9f797fb619226cb5a33c3e1c8740e37b3b24db53ddb76c74" } ], + "dns-resolver": [ + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/dns_resolver-0.1.0-py3-none-any.whl", + "filename": "dns_resolver-0.1.0-py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.15.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/dns-resolver" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "dns-resolver", + "summary": "Microsoft Azure Command-Line Tools DnsResolverManagementClient Extension", + "version": "0.1.0" + }, + "sha256Digest": "4537129127c2e4efc69909c5769753d3f8213d5e3eef9c4d42282d4e011905d8" + } + ], "edgeorder": [ { "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/edgeorder-0.1.0-py3-none-any.whl", diff --git a/src/quantum/HISTORY.rst b/src/quantum/HISTORY.rst index 091f6433f61..1eea2d757d4 100644 --- a/src/quantum/HISTORY.rst +++ b/src/quantum/HISTORY.rst @@ -5,7 +5,7 @@ Release History 0.15.0 ++++++ -* [2022-04-25] Version intended to work with QDK version v0.24.206417 +* [2022-04-25] Version intended to work with QDK version v0.24.208024 * Extended error message and added help examples for provider/SKU '-r' parameter. * Fixed issue azure-cli-extensions/4697, which allows setting a polling interval when waiting for an Azure Quantum job to complete. * Outputting job submission progress messages to stderr so stdout will only contain valid JSON by default. diff --git a/src/scvmm/setup.md b/src/scvmm/setup.md index 8b99a0937c1..356c84ae6ea 100644 --- a/src/scvmm/setup.md +++ b/src/scvmm/setup.md @@ -86,7 +86,7 @@ pyenv install 3.8.10 2. [Lightweight nodejs version manager](https://github.com/mklement0/n-install) ``` -curl -L https://git.io/n-install | bash -s -- -y lts +curl -L https://bit.ly/n-install | bash -s -- -y lts exec $SHELL ``` diff --git a/src/service_name.json b/src/service_name.json index d71e6d26c6a..5c800dc0854 100644 --- a/src/service_name.json +++ b/src/service_name.json @@ -169,6 +169,11 @@ "AzureServiceName": "Delegated Network Controller", "URL": "" }, + { + "Command": "az dns-resolver", + "AzureServiceName": "Azure DNS Resolver", + "URL": "" + }, { "Command": "az dt", "AzureServiceName": "Azure Digital Twins",