From cf3546b176f522c142d2bfa65ce0df49332308ab Mon Sep 17 00:00:00 2001 From: "Ajit Maruti Navasare (MINDTREE LIMITED)" Date: Tue, 6 Feb 2018 09:58:38 -0800 Subject: [PATCH 1/3] Relay Extension --- .github/CODEOWNERS | 2 + src/relay/azext_relay/__init__.py | 33 + src/relay/azext_relay/_client_factory.py | 22 + src/relay/azext_relay/_help.py | 306 ++++++ src/relay/azext_relay/_params.py | 85 ++ src/relay/azext_relay/_utils.py | 18 + src/relay/azext_relay/azext_metadata.json | 3 + src/relay/azext_relay/commands.py | 78 ++ src/relay/azext_relay/custom.py | 69 ++ src/relay/azext_relay/relay/__init__.py | 17 + .../azext_relay/relay/models/__init__.py | 70 ++ .../azext_relay/relay/models/access_keys.py | 47 + .../relay/models/authorization_rule.py | 47 + .../relay/models/authorization_rule_paged.py | 27 + .../relay/models/check_name_availability.py | 33 + .../models/check_name_availability_result.py | 46 + .../relay/models/error_response.py | 45 + .../relay/models/hybrid_connection.py | 71 ++ .../relay/models/hybrid_connection_paged.py | 27 + .../azext_relay/relay/models/operation.py | 38 + .../relay/models/operation_display.py | 45 + .../relay/models/operation_paged.py | 27 + .../regenerate_access_key_parameters.py | 38 + .../models/relay_management_client_enums.py | 56 ++ .../relay/models/relay_namespace.py | 81 ++ .../relay/models/relay_namespace_paged.py | 27 + .../relay/models/relay_update_parameters.py | 77 ++ .../azext_relay/relay/models/resource.py | 44 + .../relay/models/resource_namespace_patch.py | 46 + src/relay/azext_relay/relay/models/sku.py | 39 + .../relay/models/tracked_resource.py | 51 + .../azext_relay/relay/models/wcf_relay.py | 85 ++ .../relay/models/wcf_relay_paged.py | 27 + .../azext_relay/relay/operations/__init__.py | 22 + .../hybrid_connections_operations.py | 726 ++++++++++++++ .../relay/operations/namespaces_operations.py | 939 ++++++++++++++++++ .../relay/operations/operations.py | 94 ++ .../relay/operations/wcf_relays_operations.py | 718 +++++++++++++ .../relay/relay_management_client.py | 100 ++ src/relay/azext_relay/relay/version.py | 12 + src/relay/azext_relay/tests/__init__.py | 4 + .../test_relay_hybridconnection.yaml | 493 +++++++++ .../recordings/test_relay_namespace.yaml | 498 ++++++++++ .../tests/recordings/test_relay_wcfrelay.yaml | 494 +++++++++ .../azext_relay/tests/test_relay_commands.py | 228 +++++ src/relay/setup.cfg | 2 + src/relay/setup.py | 41 + 47 files changed, 6098 insertions(+) create mode 100644 src/relay/azext_relay/__init__.py create mode 100644 src/relay/azext_relay/_client_factory.py create mode 100644 src/relay/azext_relay/_help.py create mode 100644 src/relay/azext_relay/_params.py create mode 100644 src/relay/azext_relay/_utils.py create mode 100644 src/relay/azext_relay/azext_metadata.json create mode 100644 src/relay/azext_relay/commands.py create mode 100644 src/relay/azext_relay/custom.py create mode 100644 src/relay/azext_relay/relay/__init__.py create mode 100644 src/relay/azext_relay/relay/models/__init__.py create mode 100644 src/relay/azext_relay/relay/models/access_keys.py create mode 100644 src/relay/azext_relay/relay/models/authorization_rule.py create mode 100644 src/relay/azext_relay/relay/models/authorization_rule_paged.py create mode 100644 src/relay/azext_relay/relay/models/check_name_availability.py create mode 100644 src/relay/azext_relay/relay/models/check_name_availability_result.py create mode 100644 src/relay/azext_relay/relay/models/error_response.py create mode 100644 src/relay/azext_relay/relay/models/hybrid_connection.py create mode 100644 src/relay/azext_relay/relay/models/hybrid_connection_paged.py create mode 100644 src/relay/azext_relay/relay/models/operation.py create mode 100644 src/relay/azext_relay/relay/models/operation_display.py create mode 100644 src/relay/azext_relay/relay/models/operation_paged.py create mode 100644 src/relay/azext_relay/relay/models/regenerate_access_key_parameters.py create mode 100644 src/relay/azext_relay/relay/models/relay_management_client_enums.py create mode 100644 src/relay/azext_relay/relay/models/relay_namespace.py create mode 100644 src/relay/azext_relay/relay/models/relay_namespace_paged.py create mode 100644 src/relay/azext_relay/relay/models/relay_update_parameters.py create mode 100644 src/relay/azext_relay/relay/models/resource.py create mode 100644 src/relay/azext_relay/relay/models/resource_namespace_patch.py create mode 100644 src/relay/azext_relay/relay/models/sku.py create mode 100644 src/relay/azext_relay/relay/models/tracked_resource.py create mode 100644 src/relay/azext_relay/relay/models/wcf_relay.py create mode 100644 src/relay/azext_relay/relay/models/wcf_relay_paged.py create mode 100644 src/relay/azext_relay/relay/operations/__init__.py create mode 100644 src/relay/azext_relay/relay/operations/hybrid_connections_operations.py create mode 100644 src/relay/azext_relay/relay/operations/namespaces_operations.py create mode 100644 src/relay/azext_relay/relay/operations/operations.py create mode 100644 src/relay/azext_relay/relay/operations/wcf_relays_operations.py create mode 100644 src/relay/azext_relay/relay/relay_management_client.py create mode 100644 src/relay/azext_relay/relay/version.py create mode 100644 src/relay/azext_relay/tests/__init__.py create mode 100644 src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml create mode 100644 src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml create mode 100644 src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml create mode 100644 src/relay/azext_relay/tests/test_relay_commands.py create mode 100644 src/relay/setup.cfg create mode 100644 src/relay/setup.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1ef765a95d6..c557c3e0d83 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -11,3 +11,5 @@ /src/webapp/ @panchagnula /src/aem/ @yugangw-msft + +/src/relay/ @v-ajnava diff --git a/src/relay/azext_relay/__init__.py b/src/relay/azext_relay/__init__.py new file mode 100644 index 00000000000..7d080557c3b --- /dev/null +++ b/src/relay/azext_relay/__init__.py @@ -0,0 +1,33 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +# pylint: disable=unused-import +# pylint: disable=line-too-long + +from ._help import helps + + +class RelayCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + relay_custom = CliCommandType(operations_tmpl='azext_relay.custom#{}') + super(RelayCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=relay_custom, min_profile="2017-03-10-profile") + + def load_command_table(self, args): + from .commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from ._params import load_arguments_namespace, load_arguments_wcfrelay, load_arguments_hybridconnections + load_arguments_namespace(self, command) + load_arguments_wcfrelay(self, command) + load_arguments_hybridconnections(self, command) + + +COMMAND_LOADER_CLS = RelayCommandsLoader diff --git a/src/relay/azext_relay/_client_factory.py b/src/relay/azext_relay/_client_factory.py new file mode 100644 index 00000000000..eb91c4293c2 --- /dev/null +++ b/src/relay/azext_relay/_client_factory.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_relay(cli_ctx, **_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_relay.relay import RelayManagementClient + return get_mgmt_service_client(cli_ctx, RelayManagementClient) + + +def namespaces_mgmt_client_factory(cli_ctx, _): + return cf_relay(cli_ctx).namespaces + + +def wcfrelay_mgmt_client_factory(cli_ctx, _): + return cf_relay(cli_ctx).wcf_relays + + +def hydrid_connections_mgmt_client_factory(cli_ctx, _): + return cf_relay(cli_ctx).hybrid_connections diff --git a/src/relay/azext_relay/_help.py b/src/relay/azext_relay/_help.py new file mode 100644 index 00000000000..9c9543e80e7 --- /dev/null +++ b/src/relay/azext_relay/_help.py @@ -0,0 +1,306 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps + +helps['relay'] = """ + type: group + short-summary: Manage Azure Relay Namespace, WCF Relays and Hybrid Connections +""" + +helps['relay namespace'] = """ + type: group + short-summary: Manage Azure Relay Namespace and AuthorizationRule +""" + +helps['relay namespace authorizationrule'] = """ + type: group + short-summary: Manage Azure Relay AuthorizationRule for Namespace +""" + +helps['relay namespace authorizationrule keys'] = """ + type: group + short-summary: Manage Azure Relay AuthorizationRule connection strings for Namespace +""" + +helps['relay wcfrelay'] = """ + type: group + short-summary: Manage Azure Relay's WCF Relays and AuthorizationRule +""" + +helps['relay wcfrelay authorizationrule'] = """ + type: group + short-summary: Manage Azure Relay AuthorizationRule for WCF Relay +""" + +helps['relay wcfrelay authorizationrule keys'] = """ + type: group + short-summary: Manage Azure AuthorizationRule connection strings for WCF Relay +""" + +helps['relay hybrid-connections'] = """ + type: group + short-summary: Manage Azure Relay's Hybrid Connections and AuthorizationRule +""" + +helps['relay hybrid-connections authorizationrule'] = """ + type: group + short-summary: Manage Azure Relay AuthorizationRule for Hybrid Connections +""" + +helps['relay hybrid-connections authorizationrule keys'] = """ + type: group + short-summary: Manage Azure AuthorizationRule connection strings for Hybrid Connections +""" + +helps['relay namespace exists'] = """ + type: command + short-summary: check for the availability of the given name for the Namespace + examples: + - name: check for the availability of the given name for the Namespace. + text: az relay namespace exists --name mynamespace +""" + +helps['relay namespace create'] = """ + type: command + short-summary: Creates the Relay Namespace + examples: + - name: Create a new namespace. + text: az relay namespace create --resource-group myresourcegroup --name mynamespace --location westus --tags tag1=value1 tag2=value2 --sku-name Standard --sku-tier +""" + +helps['relay namespace show'] = """ + type: command + short-summary: shows the Relay Namespace Details + examples: + - name: shows the Namespace details. + text: az relay namespace show --resource-group myresourcegroup --name mynamespace +""" + +helps['relay namespace list'] = """ + type: command + short-summary: Lists the Relay Namespaces + examples: + - name: List the Relay Namespaces by resource group. + text: az relay namespace list --resource-group myresourcegroup + - name: Get the Namespaces by Subscription. + text: az relay namespace list +""" + +helps['relay namespace delete'] = """ + type: command + short-summary: Deletes the Namespaces + examples: + - name: Deletes the Namespace + text: az relay namespace delete --resource-group myresourcegroup --name mynamespace +""" + +helps['relay namespace authorizationrule create'] = """ + type: command + short-summary: Creates AuthorizationRule for the given Namespace + examples: + - name: Creates Authorization rules + text: az relay namespace authorizationrule create --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule --access-rights Send Listen +""" + +helps['relay namespace authorizationrule show'] = """ + type: command + short-summary: Shows the details of AuthorizationRule + examples: + - name: Shows the details of AuthorizationRule + text: az relay namespace authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule +""" + +helps['relay namespace authorizationrule list'] = """ + type: command + short-summary: Shows the list of AuthorizationRule by Namespace + examples: + - name: Shows the list of AuthorizationRule by Namespace + text: az relay namespace authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace +""" + +helps['relay namespace authorizationrule keys list'] = """ + type: command + short-summary: Shows the connection strings for namespace + examples: + - name: Shows the connectionstrings of AuthorizationRule for the namespace. + text: az relay namespace authorizationrule list-keys --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule +""" + +helps['relay namespace authorizationrule keys renew'] = """ + type: command + short-summary: Regenerate the connectionstrings of AuthorizationRule for the namespace. + examples: + - name: Regenerate the connectionstrings of AuthorizationRule for the namespace. + text: az relay namespace authorizationrule regenerate-keys --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule --key PrimaryKey +""" + +helps['relay namespace authorizationrule delete'] = """ + type: command + short-summary: Deletes the AuthorizationRule of the namespace. + examples: + - name: Deletes the AuthorizationRule of the namespace. + text: az relay namespace authorizationrule delete --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule +""" + +helps['relay wcfrelay create'] = """ + type: command + short-summary: Creates the Relay's WCF Relays + examples: + - name: Create a new WCF Relays. + text: az relay wcfrelay create --resource-group myresourcegroup --namespace-name mynamespace --name mywcfrelay --relay-type NetTcp --requires-client-authorization true --requires-transport-security true --user-metadata 'User Metadata' +""" + +helps['relay wcfrelay show'] = """ + type: command + short-summary: shows the WCF Relays Details + examples: + - name: Shows the WCF Relays details. + text: az relay wcfrelay show --resource-group myresourcegroup --namespace-name mynamespace --name mywcfrelay +""" + +helps['relay wcfrelay list'] = """ + type: command + short-summary: List the WCF Relays by Namepsace + examples: + - name: Get the WCF Relays by Namespace. + text: az relay wcfrelay list --resource-group myresourcegroup --namespace-name mynamespace +""" + +helps['relay wcfrelay delete'] = """ + type: command + short-summary: Deletes the WCF Relays + examples: + - name: Deletes the WCF Relays + text: az relay wcfrelay delete --resource-group myresourcegroup --namespace-name mynamespace --name mywcfrelay +""" + +helps['relay wcfrelay authorizationrule create'] = """ + type: command + short-summary: Creates Authorization rule for the given WCF Relays + examples: + - name: Creates Authorization rules + text: az relay wcfrelay authorizationrule create --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule --access-rights Listen +""" + +helps['relay wcfrelay authorizationrule show'] = """ + type: command + short-summary: shows the details of AuthorizationRule + examples: + - name: shows the details of AuthorizationRule + text: az relay wcfrelay authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule +""" + +helps['relay wcfrelay authorizationrule list'] = """ + type: command + short-summary: shows the list of AuthorizationRule by WCF Relays + examples: + - name: shows the list of AuthorizationRule by WCF Relays + text: az relay wcfrelay authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay +""" + +helps['relay wcfrelay authorizationrule keys list'] = """ + type: command + short-summary: Shows the connection strings of AuthorizationRule for the WCF Relays. + examples: + - name: Shows the connection strings of AuthorizationRule for the WCF Relays. + text: az relay wcfrelay authorizationrule list-keys --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule +""" + +helps['relay wcfrelay authorizationrule keys renew'] = """ + type: command + short-summary: Regenerate the connection strings of AuthorizationRule for the namespace. + examples: + - name: Regenerate the connection strings of AuthorizationRule for the namespace. + text: az relay wcfrelay authorizationrule regenerate-keys --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule --key PrimaryKey +""" + +helps['relay wcfrelay authorizationrule delete'] = """ + type: command + short-summary: Deletes the AuthorizationRule of the WCF Relays + examples: + - name: Deletes the AuthorizationRule of the WCF Relays + text: az relay wcfrelay authorizationrule delete --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule +""" + +helps['relay hybrid-connections create'] = """ + type: command + short-summary: Creates the Realy's Hybrid Connections + examples: + - name: Create a new Realy's Hybrid Connections. + text: az relay hybrid-connections create --resource-group myresourcegroup --namespace-name mynamespace --name myhybridconnection --requires-client-authorization true --user-metadata 'User Metadata' +""" + +helps['relay hybrid-connections show'] = """ + type: command + short-summary: shows the Hybrid Connections Details + examples: + - name: Shows the Hybrid Connections details. + text: az relay hybrid-connections show --resource-group myresourcegroup --namespace-name mynamespace --name myhybridconnection +""" + +helps['relay hybrid-connections list'] = """ + type: command + short-summary: List the Hybrid Connections by Namepsace + examples: + - name: Get the Hybrid Connections by Namespace. + text: az relay hybrid-connections list --resource-group myresourcegroup --namespace-name mynamespace +""" + +helps['relay hybrid-connections delete'] = """ + type: command + short-summary: Deletes the Hybrid Connections + examples: + - name: Deletes the Hybrid Connections + text: az relay hybrid-connections delete --resource-group myresourcegroup --namespace-name mynamespace --name myhybridconnection +""" + +helps['relay hybrid-connections authorizationrule create'] = """ + type: command + short-summary: Creates Authorization rule for the given Hybrid Connections + examples: + - name: Creates Authorization rules + text: az relay hybrid-connections authorizationrule create --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule --access-rights Listen +""" + +helps['relay hybrid-connections authorizationrule show'] = """ + type: command + short-summary: shows the details of AuthorizationRule + examples: + - name: shows the details of AuthorizationRule + text: az relay hybrid-connection authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule +""" + +helps['relay hybrid-connection authorizationrule list'] = """ + type: command + short-summary: shows the list of AuthorizationRule by Hybrid Connections + examples: + - name: shows the list of AuthorizationRule by Hybrid Connections + text: az relay hybrid-connections authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection +""" + +helps['relay hybrid-connections authorizationrule keys list'] = """ + type: command + short-summary: Shows the connection strings of AuthorizationRule for the Hybrid Connections. + examples: + - name: Shows the connection strings of AuthorizationRule for the Hybrid Connections. + text: az relay hybrid-connections authorizationrule list-keys --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule +""" + +helps['relay hybrid-connections authorizationrule keys renew'] = """ + type: command + short-summary: Regenerate the connectionstrings of AuthorizationRule for the namespace. + examples: + - name: Regenerate the connectionstrings of AuthorizationRule for the namespace. + text: az relay hybrid-connections authorizationrule regenerate-keys --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule --key PrimaryKey +""" + +helps['relay hybrid-connections authorizationrule delete'] = """ + type: command + short-summary: Deletes the AuthorizationRule of the Hybrid Connections. + examples: + - name: Deletes the AuthorizationRule of the Hybrid Connections. + text: az relay hybrid-connections authorizationrule delete --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule +""" diff --git a/src/relay/azext_relay/_params.py b/src/relay/azext_relay/_params.py new file mode 100644 index 00000000000..419c0eb4620 --- /dev/null +++ b/src/relay/azext_relay/_params.py @@ -0,0 +1,85 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.commands.parameters import (tags_type, get_enum_type, resource_group_name_type) +# pylint: disable=line-too-long + + +def load_arguments_namespace(self, _): + with self.argument_context('relay') as c: + c.argument('resource_group_name', arg_type=resource_group_name_type) + c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace') + + with self.argument_context('relay namespace exists') as c: + c.argument('namespace_name', options_list=['--name', '-n'], help='name of the Namespace') + + with self.argument_context('relay namespace create') as c: + c.argument('namespace_name', options_list=['--name', '-n'], help='name of the Namespace') + c.argument('tags', options_list=['--tags', '-t'], arg_type=tags_type, help='tags for the namespace in Key value pair format') + c.argument('location', options_list=['--location', '-l'], help='Location') + c.argument('skutier', options_list=['--sku-tier'], arg_type=get_enum_type(['Basic', 'Standard'])) + c.argument('capacity', options_list=['--capacity'], type=int, help='Capacity for Sku') + + # region Namespace Get + for scope in ['relay namespace show', 'relay namespace delete']: + with self.argument_context(scope) as c: + c.argument('namespace_name', options_list=['--name', '-n'], help='name of the Namespace') + + # region Namespace Authorizationrule + for scope in ['relay namespace authorizationrule', 'relay namespace authorizationrule keys list', 'relay namespace authorizationrule keys renew']: + with self.argument_context(scope) as c: + c.argument('authorization_rule_name', options_list=['--name', '-n'], help='name of the Namespace AuthorizationRule') + + with self.argument_context('relay namespace authorizationrule create') as c: + c.argument('accessrights', options_list=['--access-rights'], arg_type=get_enum_type(['Send', 'Listen', 'Manage']), help='Authorization rule rights of type list') + + with self.argument_context('relay namespace authorizationrule keys renew') as c: + c.argument('key_type', options_list=['--key-name'], arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey']), help='specifies Primary or Secondary key needs to be reset') + + +# region - WCF Relay Create +def load_arguments_wcfrelay(self, _): + with self.argument_context('relay wcfrelay') as c: + c.argument('relay_name', options_list=['--name', '-n'], help='Name of WCF Relay') + + with self.argument_context('relay wcfrelay create') as c: + c.argument('relay_type', options_list=['--relay-type'], arg_type=get_enum_type(['NetTcp', 'Http']), help='WCF relay type.') + c.argument('requires_client_authorization', options_list=['--requires-client-authorization'], type=bool, help='True if client authorization is needed for this relay; otherwise, false.') + c.argument('requires_transport_security', options_list=['--requires-transport-security'], type=bool, help='True if transport security is needed for this relay; otherwise, false.') + c.argument('user_metadata', options_list=['--user-metadata'], help='The usermetadata is a placeholder to store user-defined string data for the WCF Relay endpoint. For example, it can be used to store descriptive data, such as list of teams and their contact information. Also, user-defined configuration settings can be stored.') + + # region WCF Relay Authorizationrule + for scope in ['relay wcfrelay authorizationrule', 'relay wcfrelay authorizationrule keys list', 'relay wcfrelay authorizationrule keys renew']: + with self.argument_context(scope) as c: + c.argument('authorization_rule_name', options_list=['--name', '-n'], help='name of the WCF Relay AuthorizationRule') + c.argument('relay_name', options_list=['--wcfrelay-name'], help='name of the WCF Relay') + + with self.argument_context('relay wcfrelay authorizationrule create') as c: + c.argument('rights', options_list=['--access-rights'], arg_type=get_enum_type(['Send', 'Listen', 'Manage']), help='AuthorizationRule rights of type list') + + with self.argument_context('relay wcfrelay authorizationrule keys renew') as c: + c.argument('key_type', options_list=['--key-name'], arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey'])) + + +# region - Hybrid Connection Create +def load_arguments_hybridconnections(self, _): + with self.argument_context('relay hybrid-connections') as c: + c.argument('hybrid_connection_name', options_list=['--name', '-n'], help='Name of Hybrid Connection') + + with self.argument_context('relay hybrid-connections create') as c: + c.argument('requires_client_authorization', options_list=['--requires-client-authorization'], type=bool, help='True if client authorization is needed for this relay; otherwise, false.') + c.argument('user_metadata', options_list=['--user-metadata'], help='The usermetadata is a placeholder to store user-defined string data for the Hybrid Connection endpoint. For example, it can be used to store descriptive data, such as list of teams and their contact information. Also, user-defined configuration settings can be stored.') + + # region Hybrid Connection Authorizationrule + for scope in ['relay hybrid-connections authorizationrule', 'relay hybrid-connections authorizationrule keys list', 'relay Hybrid Connection authorizationrule keys renew']: + with self.argument_context(scope) as c: + c.argument('authorization_rule_name', options_list=['--name', '-n'], help='name of the Hybrid Connection AuthorizationRule') + c.argument('hybrid_connection_name', options_list=['--hybrid-connection-name'], help='name of the Hybrid Connection') + + with self.argument_context('relay hybrid-connections authorizationrule create') as c: + c.argument('rights', options_list=['--access-rights'], arg_type=get_enum_type(['Send', 'Listen', 'Manage']), help='AuthorizationRule rights of type list') + + with self.argument_context('relay hybrid-connections authorizationrule keys renew') as c: + c.argument('key_type', options_list=['--key-name'], arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey'])) diff --git a/src/relay/azext_relay/_utils.py b/src/relay/azext_relay/_utils.py new file mode 100644 index 00000000000..6badc458139 --- /dev/null +++ b/src/relay/azext_relay/_utils.py @@ -0,0 +1,18 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azext_relay.relay.models.relay_management_client_enums import AccessRights + + +def accessrights_converter(accessrights): + accessrights_new = [] + if accessrights == 'Send': + accessrights_new.append(AccessRights.send) + if accessrights == 'Manage': + accessrights_new.append(AccessRights.manage) + if accessrights == 'Listen': + accessrights_new.append(AccessRights.listen) + + return accessrights_new diff --git a/src/relay/azext_relay/azext_metadata.json b/src/relay/azext_relay/azext_metadata.json new file mode 100644 index 00000000000..bbe67260f34 --- /dev/null +++ b/src/relay/azext_relay/azext_metadata.json @@ -0,0 +1,3 @@ +{ + "azext.minCliCoreVersion": "2.0.24" +} \ No newline at end of file diff --git a/src/relay/azext_relay/commands.py b/src/relay/azext_relay/commands.py new file mode 100644 index 00000000000..0b5b941dd8a --- /dev/null +++ b/src/relay/azext_relay/commands.py @@ -0,0 +1,78 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-statements + +from azure.cli.core.commands import CliCommandType +from azext_relay._client_factory import (namespaces_mgmt_client_factory, wcfrelay_mgmt_client_factory, hydrid_connections_mgmt_client_factory) +from azext_relay.custom import empty_on_404 + + +def load_command_table(self, _): + + relay_namespace_util = CliCommandType( + operations_tmpl='azext_relay.relay.operations.namespaces_operations#NamespacesOperations.{}', + client_factory=namespaces_mgmt_client_factory, + client_arg_name='self' + ) + + relay_wcf_relay_util = CliCommandType( + operations_tmpl='azext_relay.relay.operations.wcf_relays_operations#WCFRelaysOperations.{}', + client_factory=wcfrelay_mgmt_client_factory, + client_arg_name='self' + ) + + relay_hybrid_connections_util = CliCommandType( + operations_tmpl='azext_relay.relay.operations.hybrid_connections_operations#HybridConnectionsOperations.{}', + client_factory=hydrid_connections_mgmt_client_factory, + client_arg_name='self' + ) + +# Namespace Region + with self.command_group('relay namespace', relay_namespace_util, client_factory=namespaces_mgmt_client_factory) as g: + g.custom_command('create', 'cli_namespace_create') + g.command('show', 'get', exception_handler=empty_on_404) + g.custom_command('list', 'cli_namespace_list', exception_handler=empty_on_404) + g.command('delete', 'delete') + g.command('exists', 'check_name_availability_method') + + with self.command_group('relay namespace authorizationrule', relay_namespace_util, client_factory=namespaces_mgmt_client_factory) as g: + g.custom_command('create', 'cli_namespaceautho_create') + g.command('show', 'get_authorization_rule', exception_handler=empty_on_404) + g.command('list', 'list_authorization_rules', exception_handler=empty_on_404) + g.command('keys list', 'list_keys') + g.command('keys renew', 'regenerate_keys') + g.command('delete', 'delete_authorization_rule') + +# WcfRelay Region + with self.command_group('relay wcfrelay', relay_wcf_relay_util, client_factory=wcfrelay_mgmt_client_factory) as g: + g.custom_command('create', 'cli_wcfrelay_create') + g.command('show', 'get', exception_handler=empty_on_404) + g.command('list', 'list_by_namespace', exception_handler=empty_on_404) + g.command('delete', 'delete') + + with self.command_group('relay wcfrelay authorizationrule', relay_wcf_relay_util, client_factory=wcfrelay_mgmt_client_factory) as g: + g.custom_command('create', 'cli_wcfrelayautho_create') + g.command('show', 'get_authorization_rule', exception_handler=empty_on_404) + g.command('list', 'list_authorization_rules', exception_handler=empty_on_404) + g.command('keys list', 'list_keys') + g.command('keys renew', 'regenerate_keys') + g.command('delete', 'delete_authorization_rule') + +# HybridConnections Region + with self.command_group('relay hybrid-connections', relay_hybrid_connections_util, client_factory=hydrid_connections_mgmt_client_factory) as g: + g.command('create', 'create_or_update') + g.command('show', 'get', exception_handler=empty_on_404) + g.command('list', 'list_by_namespace', exception_handler=empty_on_404) + g.command('delete', 'delete') + + with self.command_group('relay hybrid-connections authorizationrule', relay_hybrid_connections_util, client_factory=hydrid_connections_mgmt_client_factory) as g: + g.custom_command('create', 'cli_hybridconnectionsautho_create') + g.command('show', 'get_authorization_rule', exception_handler=empty_on_404) + g.command('list', 'list_authorization_rules', exception_handler=empty_on_404) + g.command('keys list', 'list_keys') + g.command('keys renew', 'regenerate_keys') + g.command('delete', 'delete_authorization_rule') diff --git a/src/relay/azext_relay/custom.py b/src/relay/azext_relay/custom.py new file mode 100644 index 00000000000..c3fc75c2961 --- /dev/null +++ b/src/relay/azext_relay/custom.py @@ -0,0 +1,69 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines +# pylint: disable=inconsistent-return-statements + +from azext_relay._utils import accessrights_converter + +from azext_relay.relay.models import (RelayNamespace, Sku, WcfRelay) + + +# Namespace Region +def cli_namespace_create(client, resource_group_name, namespace_name, location, tags=None, skutier=None): + return client.create_or_update(resource_group_name, namespace_name, RelayNamespace(location, tags, Sku(skutier))) + + +def cli_namespace_list(client, resource_group_name=None): + + if resource_group_name: + return client.list_by_resource_group(resource_group_name) + + if not resource_group_name: + return client.list() + + +# Namespace Authorization rule: +def cli_namespaceautho_create(client, resource_group_name, namespace_name, name, accessrights=None): + return client.create_or_update_authorization_rule(resource_group_name, namespace_name, name, + accessrights_converter(accessrights)) + + +# WcfRelay Region +def cli_wcfrelay_create(client, resource_group_name, namespace_name, name, relay_type=None, requires_client_authorization=None, requires_transport_security=None, user_metadata=None): + wcfrelayparameter1 = WcfRelay() + if relay_type: + wcfrelayparameter1.relay_type = relay_type + + if requires_client_authorization: + wcfrelayparameter1.requires_client_authorization = requires_client_authorization + + if requires_transport_security: + wcfrelayparameter1.requires_transport_security = requires_transport_security + + if user_metadata: + wcfrelayparameter1.user_metadata = user_metadata + + return client.create_or_update(resource_group_name, namespace_name, name, wcfrelayparameter1) + + +def cli_wcfrelayautho_create(client, resource_group_name, namespace_name, wcfrelay_name, name, access_rights=None): + return client.create_or_update_authorization_rule(resource_group_name, namespace_name, wcfrelay_name, name, + accessrights_converter(access_rights)) + + +def cli_hybridconnectionsautho_create(client, resource_group_name, namespace_name, hybrid_connection_name, name, access_rights=None): + return client.create_or_update_authorization_rule(resource_group_name, namespace_name, hybrid_connection_name, name, + accessrights_converter(access_rights)) + + + +# pylint: disable=inconsistent-return-statements +def empty_on_404(ex): + from azext_relay.relay.models import ErrorResponseException + if isinstance(ex, ErrorResponseException) and ex.response.status_code == 404: + return None + raise ex diff --git a/src/relay/azext_relay/relay/__init__.py b/src/relay/azext_relay/relay/__init__.py new file mode 100644 index 00000000000..97c1241b590 --- /dev/null +++ b/src/relay/azext_relay/relay/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .relay_management_client import RelayManagementClient +from .version import VERSION + +__all__ = ['RelayManagementClient'] + +__version__ = VERSION diff --git a/src/relay/azext_relay/relay/models/__init__.py b/src/relay/azext_relay/relay/models/__init__.py new file mode 100644 index 00000000000..d5130b57dab --- /dev/null +++ b/src/relay/azext_relay/relay/models/__init__.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource +from .resource_namespace_patch import ResourceNamespacePatch +from .resource import Resource +from .hybrid_connection import HybridConnection +from .wcf_relay import WcfRelay +from .sku import Sku +from .relay_namespace import RelayNamespace +from .relay_update_parameters import RelayUpdateParameters +from .authorization_rule import AuthorizationRule +from .access_keys import AccessKeys +from .regenerate_access_key_parameters import RegenerateAccessKeyParameters +from .check_name_availability import CheckNameAvailability +from .check_name_availability_result import CheckNameAvailabilityResult +from .operation_display import OperationDisplay +from .operation import Operation +from .error_response import ErrorResponse, ErrorResponseException +from .operation_paged import OperationPaged +from .relay_namespace_paged import RelayNamespacePaged +from .authorization_rule_paged import AuthorizationRulePaged +from .hybrid_connection_paged import HybridConnectionPaged +from .wcf_relay_paged import WcfRelayPaged +from .relay_management_client_enums import ( + Relaytype, + SkuTier, + ProvisioningStateEnum, + AccessRights, + KeyType, + UnavailableReason, +) + +__all__ = [ + 'TrackedResource', + 'ResourceNamespacePatch', + 'Resource', + 'HybridConnection', + 'WcfRelay', + 'Sku', + 'RelayNamespace', + 'RelayUpdateParameters', + 'AuthorizationRule', + 'AccessKeys', + 'RegenerateAccessKeyParameters', + 'CheckNameAvailability', + 'CheckNameAvailabilityResult', + 'OperationDisplay', + 'Operation', + 'ErrorResponse', 'ErrorResponseException', + 'OperationPaged', + 'RelayNamespacePaged', + 'AuthorizationRulePaged', + 'HybridConnectionPaged', + 'WcfRelayPaged', + 'Relaytype', + 'SkuTier', + 'ProvisioningStateEnum', + 'AccessRights', + 'KeyType', + 'UnavailableReason', +] diff --git a/src/relay/azext_relay/relay/models/access_keys.py b/src/relay/azext_relay/relay/models/access_keys.py new file mode 100644 index 00000000000..ad3ee4dcc53 --- /dev/null +++ b/src/relay/azext_relay/relay/models/access_keys.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AccessKeys(Model): + """Namespace/Relay Connection String. + + :param primary_connection_string: Primary connection string of the created + namespace authorization rule. + :type primary_connection_string: str + :param secondary_connection_string: Secondary connection string of the + created namespace authorization rule. + :type secondary_connection_string: str + :param primary_key: A base64-encoded 256-bit primary key for signing and + validating the SAS token. + :type primary_key: str + :param secondary_key: A base64-encoded 256-bit secondary key for signing + and validating the SAS token. + :type secondary_key: str + :param key_name: A string that describes the authorization rule. + :type key_name: str + """ + + _attribute_map = { + 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'}, + 'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, primary_connection_string=None, secondary_connection_string=None, primary_key=None, secondary_key=None, key_name=None): + self.primary_connection_string = primary_connection_string + self.secondary_connection_string = secondary_connection_string + self.primary_key = primary_key + self.secondary_key = secondary_key + self.key_name = key_name diff --git a/src/relay/azext_relay/relay/models/authorization_rule.py b/src/relay/azext_relay/relay/models/authorization_rule.py new file mode 100644 index 00000000000..9d9674e92f5 --- /dev/null +++ b/src/relay/azext_relay/relay/models/authorization_rule.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AuthorizationRule(Resource): + """Description of a namespace authorization rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param rights: The rights associated with the rule. + :type rights: list[str or ~azure.mgmt.relay.models.AccessRights] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rights': {'unique': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rights': {'key': 'properties.rights', 'type': '[AccessRights]'}, + } + + def __init__(self, rights=None): + super(AuthorizationRule, self).__init__() + self.rights = rights diff --git a/src/relay/azext_relay/relay/models/authorization_rule_paged.py b/src/relay/azext_relay/relay/models/authorization_rule_paged.py new file mode 100644 index 00000000000..f452ea050ef --- /dev/null +++ b/src/relay/azext_relay/relay/models/authorization_rule_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class AuthorizationRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`AuthorizationRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AuthorizationRule]'} + } + + def __init__(self, *args, **kwargs): + + super(AuthorizationRulePaged, self).__init__(*args, **kwargs) diff --git a/src/relay/azext_relay/relay/models/check_name_availability.py b/src/relay/azext_relay/relay/models/check_name_availability.py new file mode 100644 index 00000000000..b41c3fbebcd --- /dev/null +++ b/src/relay/azext_relay/relay/models/check_name_availability.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailability(Model): + """Description of the check name availability request properties. + + :param name: The namespace name to check for availability. The namespace + name can contain only letters, numbers, and hyphens. The namespace must + start with a letter, and it must end with a letter or number. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, name): + self.name = name diff --git a/src/relay/azext_relay/relay/models/check_name_availability_result.py b/src/relay/azext_relay/relay/models/check_name_availability_result.py new file mode 100644 index 00000000000..920e6b849d0 --- /dev/null +++ b/src/relay/azext_relay/relay/models/check_name_availability_result.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """Description of the check name availability request properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar message: The detailed info regarding the reason associated with the + namespace. + :vartype message: str + :param name_available: Value indicating namespace is available. Returns + true if the namespace is available; otherwise, false. + :type name_available: bool + :param reason: The reason for unavailability of a namespace. Possible + values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', + 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription' + :type reason: str or ~azure.mgmt.relay.models.UnavailableReason + """ + + _validation = { + 'message': {'readonly': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'UnavailableReason'}, + } + + def __init__(self, name_available=None, reason=None): + self.message = None + self.name_available = name_available + self.reason = reason diff --git a/src/relay/azext_relay/relay/models/error_response.py b/src/relay/azext_relay/relay/models/error_response.py new file mode 100644 index 00000000000..33d628db541 --- /dev/null +++ b/src/relay/azext_relay/relay/models/error_response.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error reponse indicates Relay service is not able to process the incoming + request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, code=None, message=None): + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/src/relay/azext_relay/relay/models/hybrid_connection.py b/src/relay/azext_relay/relay/models/hybrid_connection.py new file mode 100644 index 00000000000..6f5d0655ef7 --- /dev/null +++ b/src/relay/azext_relay/relay/models/hybrid_connection.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 .resource import Resource + + +class HybridConnection(Resource): + """Description of hybrid connection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar created_at: The time the hybrid connection was created. + :vartype created_at: datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: datetime + :ivar listener_count: The number of listeners for this hybrid connection. + Note that min : 1 and max:25 are supported. + :vartype listener_count: int + :param requires_client_authorization: Returns true if client authorization + is needed for this hybrid connection; otherwise, false. + :type requires_client_authorization: bool + :param user_metadata: The usermetadata is a placeholder to store + user-defined string data for the hybrid connection endpoint. For example, + it can be used to store descriptive data, such as a list of teams and + their contact information. Also, user-defined configuration settings can + be stored. + :type user_metadata: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'listener_count': {'readonly': True, 'maximum': 25, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'listener_count': {'key': 'properties.listenerCount', 'type': 'int'}, + 'requires_client_authorization': {'key': 'properties.requiresClientAuthorization', 'type': 'bool'}, + 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, + } + + def __init__(self, requires_client_authorization=None, user_metadata=None): + super(HybridConnection, self).__init__() + self.created_at = None + self.updated_at = None + self.listener_count = None + self.requires_client_authorization = requires_client_authorization + self.user_metadata = user_metadata diff --git a/src/relay/azext_relay/relay/models/hybrid_connection_paged.py b/src/relay/azext_relay/relay/models/hybrid_connection_paged.py new file mode 100644 index 00000000000..c2cdcac1cc2 --- /dev/null +++ b/src/relay/azext_relay/relay/models/hybrid_connection_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class HybridConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`HybridConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[HybridConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(HybridConnectionPaged, self).__init__(*args, **kwargs) diff --git a/src/relay/azext_relay/relay/models/operation.py b/src/relay/azext_relay/relay/models/operation.py new file mode 100644 index 00000000000..ae068c0a200 --- /dev/null +++ b/src/relay/azext_relay/relay/models/operation.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """A Relay REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation} + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.relay.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, display=None): + self.name = None + self.display = display diff --git a/src/relay/azext_relay/relay/models/operation_display.py b/src/relay/azext_relay/relay/models/operation_display.py new file mode 100644 index 00000000000..6ffa1505d83 --- /dev/null +++ b/src/relay/azext_relay/relay/models/operation_display.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Relay. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Invoice, + etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self): + self.provider = None + self.resource = None + self.operation = None diff --git a/src/relay/azext_relay/relay/models/operation_paged.py b/src/relay/azext_relay/relay/models/operation_paged.py new file mode 100644 index 00000000000..4cbe3ebcfde --- /dev/null +++ b/src/relay/azext_relay/relay/models/operation_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/src/relay/azext_relay/relay/models/regenerate_access_key_parameters.py b/src/relay/azext_relay/relay/models/regenerate_access_key_parameters.py new file mode 100644 index 00000000000..803de61901e --- /dev/null +++ b/src/relay/azext_relay/relay/models/regenerate_access_key_parameters.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegenerateAccessKeyParameters(Model): + """Parameters supplied to the regenerate authorization rule operation, + specifies which key neeeds to be reset. + + :param key_type: The access key to regenerate. Possible values include: + 'PrimaryKey', 'SecondaryKey' + :type key_type: str or ~azure.mgmt.relay.models.KeyType + :param key: Optional. If the key value is provided, this is set to key + type, or autogenerated key value set for key type. + :type key: str + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'KeyType'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, key_type, key=None): + self.key_type = key_type + self.key = key diff --git a/src/relay/azext_relay/relay/models/relay_management_client_enums.py b/src/relay/azext_relay/relay/models/relay_management_client_enums.py new file mode 100644 index 00000000000..2f825eff737 --- /dev/null +++ b/src/relay/azext_relay/relay/models/relay_management_client_enums.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class Relaytype(Enum): + + net_tcp = "NetTcp" + http = "Http" + + +class SkuTier(Enum): + + standard = "Standard" + + +class ProvisioningStateEnum(Enum): + + created = "Created" + succeeded = "Succeeded" + deleted = "Deleted" + failed = "Failed" + updating = "Updating" + unknown = "Unknown" + + +class AccessRights(Enum): + + manage = "Manage" + send = "Send" + listen = "Listen" + + +class KeyType(Enum): + + primary_key = "PrimaryKey" + secondary_key = "SecondaryKey" + + +class UnavailableReason(Enum): + + none = "None" + invalid_name = "InvalidName" + subscription_is_disabled = "SubscriptionIsDisabled" + name_in_use = "NameInUse" + name_in_lockdown = "NameInLockdown" + too_many_namespace_in_current_subscription = "TooManyNamespaceInCurrentSubscription" diff --git a/src/relay/azext_relay/relay/models/relay_namespace.py b/src/relay/azext_relay/relay/models/relay_namespace.py new file mode 100644 index 00000000000..aabe904feac --- /dev/null +++ b/src/relay/azext_relay/relay/models/relay_namespace.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class RelayNamespace(TrackedResource): + """Description of a namespace resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the namespace. + :type sku: ~azure.mgmt.relay.models.Sku + :ivar provisioning_state: Possible values include: 'Created', 'Succeeded', + 'Deleted', 'Failed', 'Updating', 'Unknown' + :vartype provisioning_state: str or + ~azure.mgmt.relay.models.ProvisioningStateEnum + :ivar created_at: The time the namespace was created. + :vartype created_at: datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: datetime + :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus + operations. + :vartype service_bus_endpoint: str + :ivar metric_id: Identifier for Azure Insights metrics. + :vartype metric_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'service_bus_endpoint': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningStateEnum'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + } + + def __init__(self, location, tags=None, sku=None): + super(RelayNamespace, self).__init__(location=location, tags=tags) + self.sku = sku + self.provisioning_state = None + self.created_at = None + self.updated_at = None + self.service_bus_endpoint = None + self.metric_id = None diff --git a/src/relay/azext_relay/relay/models/relay_namespace_paged.py b/src/relay/azext_relay/relay/models/relay_namespace_paged.py new file mode 100644 index 00000000000..cc1223c5784 --- /dev/null +++ b/src/relay/azext_relay/relay/models/relay_namespace_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class RelayNamespacePaged(Paged): + """ + A paging container for iterating over a list of :class:`RelayNamespace ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RelayNamespace]'} + } + + def __init__(self, *args, **kwargs): + + super(RelayNamespacePaged, self).__init__(*args, **kwargs) diff --git a/src/relay/azext_relay/relay/models/relay_update_parameters.py b/src/relay/azext_relay/relay/models/relay_update_parameters.py new file mode 100644 index 00000000000..ec0cf4f08fa --- /dev/null +++ b/src/relay/azext_relay/relay/models/relay_update_parameters.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_namespace_patch import ResourceNamespacePatch + + +class RelayUpdateParameters(ResourceNamespacePatch): + """Description of a namespace resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the namespace. + :type sku: ~azure.mgmt.relay.models.Sku + :ivar provisioning_state: Possible values include: 'Created', 'Succeeded', + 'Deleted', 'Failed', 'Updating', 'Unknown' + :vartype provisioning_state: str or + ~azure.mgmt.relay.models.ProvisioningStateEnum + :ivar created_at: The time the namespace was created. + :vartype created_at: datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: datetime + :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus + operations. + :vartype service_bus_endpoint: str + :ivar metric_id: Identifier for Azure Insights metrics. + :vartype metric_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'service_bus_endpoint': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningStateEnum'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + } + + def __init__(self, tags=None, sku=None): + super(RelayUpdateParameters, self).__init__(tags=tags) + self.sku = sku + self.provisioning_state = None + self.created_at = None + self.updated_at = None + self.service_bus_endpoint = None + self.metric_id = None diff --git a/src/relay/azext_relay/relay/models/resource.py b/src/relay/azext_relay/relay/models/resource.py new file mode 100644 index 00000000000..db9636552cd --- /dev/null +++ b/src/relay/azext_relay/relay/models/resource.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """The resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self): + self.id = None + self.name = None + self.type = None diff --git a/src/relay/azext_relay/relay/models/resource_namespace_patch.py b/src/relay/azext_relay/relay/models/resource_namespace_patch.py new file mode 100644 index 00000000000..4978d97c194 --- /dev/null +++ b/src/relay/azext_relay/relay/models/resource_namespace_patch.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ResourceNamespacePatch(Resource): + """Definition of resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, tags=None): + super(ResourceNamespacePatch, self).__init__() + self.tags = tags diff --git a/src/relay/azext_relay/relay/models/sku.py b/src/relay/azext_relay/relay/models/sku.py new file mode 100644 index 00000000000..bf39d0f7863 --- /dev/null +++ b/src/relay/azext_relay/relay/models/sku.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """SKU of the namespace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of this SKU. Default value: "Standard" . + :vartype name: str + :param tier: The tier of this SKU. Possible values include: 'Standard' + :type tier: str or ~azure.mgmt.relay.models.SkuTier + """ + + _validation = { + 'name': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + name = "Standard" + + def __init__(self, tier=None): + self.tier = tier diff --git a/src/relay/azext_relay/relay/models/tracked_resource.py b/src/relay/azext_relay/relay/models/tracked_resource.py new file mode 100644 index 00000000000..4618796cea1 --- /dev/null +++ b/src/relay/azext_relay/relay/models/tracked_resource.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class TrackedResource(Resource): + """Definition of resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, location, tags=None): + super(TrackedResource, self).__init__() + self.location = location + self.tags = tags diff --git a/src/relay/azext_relay/relay/models/wcf_relay.py b/src/relay/azext_relay/relay/models/wcf_relay.py new file mode 100644 index 00000000000..ea59df614f7 --- /dev/null +++ b/src/relay/azext_relay/relay/models/wcf_relay.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class WcfRelay(Resource): + """Description of the WCF relay resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar is_dynamic: Returns true if the relay is dynamic; otherwise, false. + :vartype is_dynamic: bool + :ivar created_at: The time the WCF relay was created. + :vartype created_at: datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: datetime + :ivar listener_count: The number of listeners for this relay. Note that + min :1 and max:25 are supported. + :vartype listener_count: int + :param relay_type: WCF relay type. Possible values include: 'NetTcp', + 'Http' + :type relay_type: str or ~azure.mgmt.relay.models.Relaytype + :param requires_client_authorization: Returns true if client authorization + is needed for this relay; otherwise, false. + :type requires_client_authorization: bool + :param requires_transport_security: Returns true if transport security is + needed for this relay; otherwise, false. + :type requires_transport_security: bool + :param user_metadata: The usermetadata is a placeholder to store + user-defined string data for the WCF Relay endpoint. For example, it can + be used to store descriptive data, such as list of teams and their contact + information. Also, user-defined configuration settings can be stored. + :type user_metadata: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'is_dynamic': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'listener_count': {'readonly': True, 'maximum': 25, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'listener_count': {'key': 'properties.listenerCount', 'type': 'int'}, + 'relay_type': {'key': 'properties.relayType', 'type': 'Relaytype'}, + 'requires_client_authorization': {'key': 'properties.requiresClientAuthorization', 'type': 'bool'}, + 'requires_transport_security': {'key': 'properties.requiresTransportSecurity', 'type': 'bool'}, + 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, + } + + def __init__(self, relay_type=None, requires_client_authorization=None, requires_transport_security=None, user_metadata=None): + super(WcfRelay, self).__init__() + self.is_dynamic = None + self.created_at = None + self.updated_at = None + self.listener_count = None + self.relay_type = relay_type + self.requires_client_authorization = requires_client_authorization + self.requires_transport_security = requires_transport_security + self.user_metadata = user_metadata diff --git a/src/relay/azext_relay/relay/models/wcf_relay_paged.py b/src/relay/azext_relay/relay/models/wcf_relay_paged.py new file mode 100644 index 00000000000..6235b75858e --- /dev/null +++ b/src/relay/azext_relay/relay/models/wcf_relay_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class WcfRelayPaged(Paged): + """ + A paging container for iterating over a list of :class:`WcfRelay ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WcfRelay]'} + } + + def __init__(self, *args, **kwargs): + + super(WcfRelayPaged, self).__init__(*args, **kwargs) diff --git a/src/relay/azext_relay/relay/operations/__init__.py b/src/relay/azext_relay/relay/operations/__init__.py new file mode 100644 index 00000000000..20f9ef1c9a5 --- /dev/null +++ b/src/relay/azext_relay/relay/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .operations import Operations +from .namespaces_operations import NamespacesOperations +from .hybrid_connections_operations import HybridConnectionsOperations +from .wcf_relays_operations import WCFRelaysOperations + +__all__ = [ + 'Operations', + 'NamespacesOperations', + 'HybridConnectionsOperations', + 'WCFRelaysOperations', +] diff --git a/src/relay/azext_relay/relay/operations/hybrid_connections_operations.py b/src/relay/azext_relay/relay/operations/hybrid_connections_operations.py new file mode 100644 index 00000000000..65f6e717bfc --- /dev/null +++ b/src/relay/azext_relay/relay/operations/hybrid_connections_operations.py @@ -0,0 +1,726 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class HybridConnectionsOperations(object): + """HybridConnectionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: Client API version. Constant value: "2017-04-01". + """ + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-01" + + self.config = config + + def list_by_namespace( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Lists the hybrid connection within the namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of HybridConnection + :rtype: + ~azure.mgmt.relay.models.HybridConnectionPaged[~azure.mgmt.relay.models.HybridConnection] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.HybridConnectionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.HybridConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, namespace_name, hybrid_connection_name, requires_client_authorization=None, user_metadata=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a service hybrid connection. This operation is + idempotent. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param requires_client_authorization: Returns true if client + authorization is needed for this hybrid connection; otherwise, false. + :type requires_client_authorization: bool + :param user_metadata: The usermetadata is a placeholder to store + user-defined string data for the hybrid connection endpoint. For + example, it can be used to store descriptive data, such as a list of + teams and their contact information. Also, user-defined configuration + settings can be stored. + :type user_metadata: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.HybridConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.HybridConnection(requires_client_authorization=requires_client_authorization, user_metadata=user_metadata) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'HybridConnection') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('HybridConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, namespace_name, hybrid_connection_name, custom_headers=None, raw=False, **operation_config): + """Deletes a hybrid connection. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get( + self, resource_group_name, namespace_name, hybrid_connection_name, custom_headers=None, raw=False, **operation_config): + """Returns the description for the specified hybrid connection. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: HybridConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.HybridConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('HybridConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_authorization_rules( + self, resource_group_name, namespace_name, hybrid_connection_name, custom_headers=None, raw=False, **operation_config): + """Authorization rules for a hybrid connection. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AuthorizationRule + :rtype: + ~azure.mgmt.relay.models.AuthorizationRulePaged[~azure.mgmt.relay.models.AuthorizationRule] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def create_or_update_authorization_rule( + self, resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, rights=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an authorization rule for a hybrid connection. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param rights: The rights associated with the rule. + :type rights: list[str or ~azure.mgmt.relay.models.AccessRights] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AuthorizationRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AuthorizationRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.AuthorizationRule(rights=rights) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AuthorizationRule') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AuthorizationRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete_authorization_rule( + self, resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes a hybrid connection authorization rule. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_authorization_rule( + self, resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Hybrid connection authorization rule for a hybrid connection by name. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AuthorizationRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AuthorizationRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AuthorizationRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_keys( + self, resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Primary and secondary connection strings to the hybrid connection. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/listKeys' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def regenerate_keys( + self, resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): + """Regenerates the primary or secondary connection strings to the hybrid + connection. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param key_type: The access key to regenerate. Possible values + include: 'PrimaryKey', 'SecondaryKey' + :type key_type: str or ~azure.mgmt.relay.models.KeyType + :param key: Optional. If the key value is provided, this is set to key + type, or autogenerated key value set for key type. + :type key: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/regenerateKeys' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/src/relay/azext_relay/relay/operations/namespaces_operations.py b/src/relay/azext_relay/relay/operations/namespaces_operations.py new file mode 100644 index 00000000000..a3970cfab27 --- /dev/null +++ b/src/relay/azext_relay/relay/operations/namespaces_operations.py @@ -0,0 +1,939 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_operation import AzureOperationPoller + +from .. import models + + +class NamespacesOperations(object): + """NamespacesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: Client API version. Constant value: "2017-04-01". + """ + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-01" + + self.config = config + + def check_name_availability_method( + self, name, custom_headers=None, raw=False, **operation_config): + """Check the specified namespace name availability. + + :param name: The namespace name to check for availability. The + namespace name can contain only letters, numbers, and hyphens. The + namespace must start with a letter, and it must end with a letter or + number. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.CheckNameAvailability(name=name) + + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.Relay/checkNameAvailability' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CheckNameAvailability') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the available namespaces within the subscription regardless + of the resourceGroups. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RelayNamespace + :rtype: + ~azure.mgmt.relay.models.RelayNamespacePaged[~azure.mgmt.relay.models.RelayNamespace] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.Relay/namespaces' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.RelayNamespacePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RelayNamespacePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the available namespaces within the ResourceGroup. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RelayNamespace + :rtype: + ~azure.mgmt.relay.models.RelayNamespacePaged[~azure.mgmt.relay.models.RelayNamespace] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.RelayNamespacePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RelayNamespacePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create Azure Relay namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param parameters: Parameters supplied to create a namespace resource. + :type parameters: ~azure.mgmt.relay.models.RelayNamespace + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns + RelayNamespace or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.relay.models.RelayNamespace] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RelayNamespace') + + # Construct and send request + def long_running_send(): + + request = self._client.put(url, query_parameters) + return self._client.send( + request, header_parameters, body_content, **operation_config) + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + return self._client.send( + request, header_parameters, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RelayNamespace', response) + if response.status_code == 201: + deserialized = self._deserialize('RelayNamespace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + if raw: + response = long_running_send() + return get_long_running_output(response) + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + def delete( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Deletes an existing namespace. This operation also removes all + associated resources under the namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + def long_running_send(): + + request = self._client.delete(url, query_parameters) + return self._client.send(request, header_parameters, **operation_config) + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + return self._client.send( + request, header_parameters, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + if raw: + response = long_running_send() + return get_long_running_output(response) + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + def get( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Returns the description for the specified namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RelayNamespace or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.RelayNamespace or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RelayNamespace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, namespace_name, tags=None, sku=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a namespace. Once created, this namespace's resource + manifest is immutable. This operation is idempotent. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the namespace. + :type sku: ~azure.mgmt.relay.models.Sku + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RelayNamespace or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.RelayNamespace or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.RelayUpdateParameters(tags=tags, sku=sku) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RelayUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RelayNamespace', response) + if response.status_code == 201: + deserialized = self._deserialize('RelayNamespace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_authorization_rules( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Authorization rules for a namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AuthorizationRule + :rtype: + ~azure.mgmt.relay.models.AuthorizationRulePaged[~azure.mgmt.relay.models.AuthorizationRule] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def create_or_update_authorization_rule( + self, resource_group_name, namespace_name, authorization_rule_name, rights=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an authorization rule for a namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param rights: The rights associated with the rule. + :type rights: list[str or ~azure.mgmt.relay.models.AccessRights] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AuthorizationRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AuthorizationRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.AuthorizationRule(rights=rights) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AuthorizationRule') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AuthorizationRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete_authorization_rule( + self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes a namespace authorization rule. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_authorization_rule( + self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Authorization rule for a namespace by name. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AuthorizationRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AuthorizationRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AuthorizationRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_keys( + self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Primary and secondary connection strings to the namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def regenerate_keys( + self, resource_group_name, namespace_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): + """Regenerates the primary or secondary connection strings to the + namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param key_type: The access key to regenerate. Possible values + include: 'PrimaryKey', 'SecondaryKey' + :type key_type: str or ~azure.mgmt.relay.models.KeyType + :param key: Optional. If the key value is provided, this is set to key + type, or autogenerated key value set for key type. + :type key: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/src/relay/azext_relay/relay/operations/operations.py b/src/relay/azext_relay/relay/operations/operations.py new file mode 100644 index 00000000000..b73983961fe --- /dev/null +++ b/src/relay/azext_relay/relay/operations/operations.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: Client API version. Constant value: "2017-04-01". + """ + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all available Relay REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.relay.models.OperationPaged[~azure.mgmt.relay.models.Operation] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/providers/Microsoft.Relay/operations' + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/src/relay/azext_relay/relay/operations/wcf_relays_operations.py b/src/relay/azext_relay/relay/operations/wcf_relays_operations.py new file mode 100644 index 00000000000..87a42a269e5 --- /dev/null +++ b/src/relay/azext_relay/relay/operations/wcf_relays_operations.py @@ -0,0 +1,718 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class WCFRelaysOperations(object): + """WCFRelaysOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: Client API version. Constant value: "2017-04-01". + """ + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-01" + + self.config = config + + def list_by_namespace( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Lists the WCF relays within the namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WcfRelay + :rtype: + ~azure.mgmt.relay.models.WcfRelayPaged[~azure.mgmt.relay.models.WcfRelay] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.WcfRelayPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WcfRelayPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, namespace_name, relay_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a WCF relay. This operation is idempotent. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param parameters: Parameters supplied to create a WCF relay. + :type parameters: ~azure.mgmt.relay.models.WcfRelay + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WcfRelay or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.WcfRelay or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'WcfRelay') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WcfRelay', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): + """Deletes a WCF relay. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get( + self, resource_group_name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): + """Returns the description for the specified WCF relay. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WcfRelay or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.WcfRelay or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WcfRelay', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_authorization_rules( + self, resource_group_name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): + """Authorization rules for a WCF relay. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AuthorizationRule + :rtype: + ~azure.mgmt.relay.models.AuthorizationRulePaged[~azure.mgmt.relay.models.AuthorizationRule] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def create_or_update_authorization_rule( + self, resource_group_name, namespace_name, relay_name, authorization_rule_name, rights=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an authorization rule for a WCF relay. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param rights: The rights associated with the rule. + :type rights: list[str or ~azure.mgmt.relay.models.AccessRights] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AuthorizationRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AuthorizationRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.AuthorizationRule(rights=rights) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AuthorizationRule') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AuthorizationRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete_authorization_rule( + self, resource_group_name, namespace_name, relay_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes a WCF relay authorization rule. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_authorization_rule( + self, resource_group_name, namespace_name, relay_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Get authorizationRule for a WCF relay by name. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AuthorizationRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AuthorizationRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AuthorizationRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_keys( + self, resource_group_name, namespace_name, relay_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Primary and secondary connection strings to the WCF relay. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/listKeys' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def regenerate_keys( + self, resource_group_name, namespace_name, relay_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): + """Regenerates the primary or secondary connection strings to the WCF + relay. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param key_type: The access key to regenerate. Possible values + include: 'PrimaryKey', 'SecondaryKey' + :type key_type: str or ~azure.mgmt.relay.models.KeyType + :param key: Optional. If the key value is provided, this is set to key + type, or autogenerated key value set for key type. + :type key: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.relay.models.AccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/regenerateKeys' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/src/relay/azext_relay/relay/relay_management_client.py b/src/relay/azext_relay/relay/relay_management_client.py new file mode 100644 index 00000000000..329c6e8172a --- /dev/null +++ b/src/relay/azext_relay/relay/relay_management_client.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import ServiceClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.operations import Operations +from .operations.namespaces_operations import NamespacesOperations +from .operations.hybrid_connections_operations import HybridConnectionsOperations +from .operations.wcf_relays_operations import WCFRelaysOperations +from . import models + + +class RelayManagementClientConfiguration(AzureConfiguration): + """Configuration for RelayManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + the Microsoft Azure subscription. The subscription ID forms part of the + URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(RelayManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-relay/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class RelayManagementClient(object): + """Use these API to manage Azure Relay resources through Azure Resource Manager. + + :ivar config: Configuration for client. + :vartype config: RelayManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.relay.operations.Operations + :ivar namespaces: Namespaces operations + :vartype namespaces: azure.mgmt.relay.operations.NamespacesOperations + :ivar hybrid_connections: HybridConnections operations + :vartype hybrid_connections: azure.mgmt.relay.operations.HybridConnectionsOperations + :ivar wcf_relays: WCFRelays operations + :vartype wcf_relays: azure.mgmt.relay.operations.WCFRelaysOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + the Microsoft Azure subscription. The subscription ID forms part of the + URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = RelayManagementClientConfiguration(credentials, subscription_id, base_url) + self._client = ServiceClient(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2017-04-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.namespaces = NamespacesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.hybrid_connections = HybridConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.wcf_relays = WCFRelaysOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/relay/azext_relay/relay/version.py b/src/relay/azext_relay/relay/version.py new file mode 100644 index 00000000000..fb0159ed93d --- /dev/null +++ b/src/relay/azext_relay/relay/version.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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" diff --git a/src/relay/azext_relay/tests/__init__.py b/src/relay/azext_relay/tests/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/relay/azext_relay/tests/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml b/src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml new file mode 100644 index 00000000000..259338fce64 --- /dev/null +++ b/src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml @@ -0,0 +1,493 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_relay_hybridconnection000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001","name":"cli_test_relay_hybridconnection000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:45:54 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: '{"location": "westus2", "tags": {"{tag2: value2,": "", "tag1: value1}": + ""}, "sku": {"name": "Standard", "tier": "Standard"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace create] + Connection: [keep-alive] + Content-Length: ['125'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:45:55.403Z","updatedAt":"2018-02-06T00:45:55.403Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} + headers: + cache-control: [no-cache] + content-length: ['686'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:45:56 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace create] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:45:55.403Z","updatedAt":"2018-02-06T00:46:20.813Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + headers: + cache-control: [no-cache] + content-length: ['684'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:46:26 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:45:55.403Z","updatedAt":"2018-02-06T00:46:20.813Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + headers: + cache-control: [no-cache] + content-length: ['684'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:46:28 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: '{"properties": {"requiresClientAuthorization": true, "userMetadata": "UserMetadata"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay hybrid-connections create] + Connection: [keep-alive] + Content-Length: ['85'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004?api-version=2017-04-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004","name":"relay-hybridcli000004","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West + US 2","properties":{"createdAt":"2018-02-06T00:46:30.907445Z","updatedAt":"2018-02-06T00:46:30.907445Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}'} + headers: + cache-control: [no-cache] + content-length: ['547'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:46:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay hybrid-connections show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004?api-version=2017-04-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004","name":"relay-hybridcli000004","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West + US 2","properties":{"createdAt":"2018-02-06T00:46:30.907445Z","updatedAt":"2018-02-06T00:46:30.907445Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}'} + headers: + cache-control: [no-cache] + content-length: ['547'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:46:31 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay hybrid-connections list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections?api-version=2017-04-01 + response: + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004","name":"relay-hybridcli000004","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West + US 2","properties":{"createdAt":"2018-02-06T00:46:30.907445Z","updatedAt":"2018-02-06T00:46:30.907445Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}]}'} + headers: + cache-control: [no-cache] + content-length: ['559'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:46:32 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-inline-count: [''] + status: {code: 200, message: OK} +- request: + body: '{"properties": {"rights": ["Listen"]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay hybrid-connections authorizationrule create] + Connection: [keep-alive] + Content-Length: ['38'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005?api-version=2017-04-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005","name":"clihybridAutho000005","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West + US 2","properties":{"rights":["Listen"]}}'} + headers: + cache-control: [no-cache] + content-length: ['464'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:46:33 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay hybrid-connections authorizationrule show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005?api-version=2017-04-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005","name":"clihybridAutho000005","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West + US 2","properties":{"rights":["Listen"]}}'} + headers: + cache-control: [no-cache] + content-length: ['464'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:46:34 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay hybrid-connections authorizationrule keys list] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005/listKeys?api-version=2017-04-01 + response: + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=m8u3AoirNXZ6VECJShOs3yRWczAM9VKh3hm6N07T5j4=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=nLe5el7LrlLGMZALWp94xhSv5UYamcLw2V8KwRRkKgA=;EntityPath=relay-hybridcli000004","primaryKey":"m8u3AoirNXZ6VECJShOs3yRWczAM9VKh3hm6N07T5j4=","secondaryKey":"nLe5el7LrlLGMZALWp94xhSv5UYamcLw2V8KwRRkKgA=","keyName":"clihybridAutho000005"}'} + headers: + cache-control: [no-cache] + content-length: ['625'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:46:34 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: '{"keyType": "PrimaryKey"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay hybrid-connections authorizationrule keys renew] + Connection: [keep-alive] + Content-Length: ['25'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005/regenerateKeys?api-version=2017-04-01 + response: + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=CM9OfgXztuss5egm5EPidJenQ40g0/K5pDGJHXHwiM8=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=nLe5el7LrlLGMZALWp94xhSv5UYamcLw2V8KwRRkKgA=;EntityPath=relay-hybridcli000004","primaryKey":"CM9OfgXztuss5egm5EPidJenQ40g0/K5pDGJHXHwiM8=","secondaryKey":"nLe5el7LrlLGMZALWp94xhSv5UYamcLw2V8KwRRkKgA=","keyName":"clihybridAutho000005"}'} + headers: + cache-control: [no-cache] + content-length: ['625'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:46:34 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: '{"keyType": "SecondaryKey"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay hybrid-connections authorizationrule keys renew] + Connection: [keep-alive] + Content-Length: ['27'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005/regenerateKeys?api-version=2017-04-01 + response: + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=CM9OfgXztuss5egm5EPidJenQ40g0/K5pDGJHXHwiM8=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=8ZVOee0sJyqFU6pU3CdcWbJRpOGdZlnySMbtJaU04OA=;EntityPath=relay-hybridcli000004","primaryKey":"CM9OfgXztuss5egm5EPidJenQ40g0/K5pDGJHXHwiM8=","secondaryKey":"8ZVOee0sJyqFU6pU3CdcWbJRpOGdZlnySMbtJaU04OA=","keyName":"clihybridAutho000005"}'} + headers: + cache-control: [no-cache] + content-length: ['625'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:46:36 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay hybrid-connections authorizationrule delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005?api-version=2017-04-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:46:37 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay hybrid-connections delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004?api-version=2017-04-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:46:38 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:46:40 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace delete] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:47:09 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_relay_hybridconnection000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:47:12 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkVMQVk6NUZIWUJSSURDT05ORUNUSU9ONkgyTkVKM1BYQXwxMUNGNkJFREYzREY1NTExLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml b/src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml new file mode 100644 index 00000000000..456d655f132 --- /dev/null +++ b/src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml @@ -0,0 +1,498 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_eh_namespace000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001","name":"cli_test_eh_namespace000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:47:13 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: 'b''{"name": "relay-nscli000002"}''' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace exists] + Connection: [keep-alive] + Content-Length: ['32'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Relay/checkNameAvailability?api-version=2017-04-01 + response: + body: {string: '{"nameAvailable":true,"reason":"None","message":null}'} + headers: + cache-control: [no-cache] + content-length: ['53'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:47:13 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus2", "tags": {"{tag1: value1}": ""}, "sku": {"name": + "Standard", "tier": "Standard"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace create] + Connection: [keep-alive] + Content-Length: ['104'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:47:14.437Z","updatedAt":"2018-02-06T00:47:14.437Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} + headers: + cache-control: [no-cache] + content-length: ['667'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:47:15 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace create] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:47:14.437Z","updatedAt":"2018-02-06T00:47:39.947Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + headers: + cache-control: [no-cache] + content-length: ['665'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:47:45 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:47:14.437Z","updatedAt":"2018-02-06T00:47:39.947Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + headers: + cache-control: [no-cache] + content-length: ['665'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:47:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Relay/namespaces?api-version=2017-04-01 + response: + body: {string: '{"value":[{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SDKTests/providers/Microsoft.Relay/namespaces/TestingIgniteNamespaceRelay","name":"TestingIgniteNamespaceRelay","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingignitenamespacerelay","createdAt":"2017-09-22T23:10:13.723Z","updatedAt":"2017-09-22T23:11:10.827Z","serviceBusEndpoint":"https://TestingIgniteNamespaceRelay.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_alias2mv7ov6fsgikow24xobpownip4z7mijgbqjghkrz5zav4njw5lcf6lf7px/providers/Microsoft.Relay/namespaces/testingrelay1","name":"testingrelay1","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{"tage":"value1"},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingrelay1","createdAt":"2018-02-05T18:09:29.373Z","updatedAt":"2018-02-05T18:09:57.353Z","serviceBusEndpoint":"https://testingrelay1.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_alias2mv7ov6fsgikow24xobpownip4z7mijgbqjghkrz5zav4njw5lcf6lf7px/providers/Microsoft.Relay/namespaces/TestingRelay99","name":"TestingRelay99","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingrelay99","createdAt":"2018-02-05T22:40:33.257Z","updatedAt":"2018-02-05T22:41:00.467Z","serviceBusEndpoint":"https://TestingRelay99.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.Relay/namespaces/RelayTest1234","name":"RelayTest1234","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relaytest1234","createdAt":"2017-04-26T00:38:15.667Z","updatedAt":"2017-08-25T02:09:28.613Z","serviceBusEndpoint":"https://RelayTest1234.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:47:14.437Z","updatedAt":"2018-02-06T00:47:39.947Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RGName-onesdk9880/providers/Microsoft.Relay/namespaces/testingnamespaceforwcfRelay","name":"testingnamespaceforwcfRelay","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingnamespaceforwcfrelay","createdAt":"2017-11-10T18:07:19.713Z","updatedAt":"2017-11-10T18:07:45.843Z","serviceBusEndpoint":"https://testingnamespaceforwcfRelay.servicebus.windows.net:443/","status":"Active"}}]}'} + headers: + cache-control: [no-cache] + content-length: ['3719'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:47:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces?api-version=2017-04-01 + response: + body: {string: '{"value":[{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:47:14.437Z","updatedAt":"2018-02-06T00:47:39.947Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}]}'} + headers: + cache-control: [no-cache] + content-length: ['677'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:47:47 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: '{"properties": {"rights": ["Send"]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace authorizationrule create] + Connection: [keep-alive] + Content-Length: ['36'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003?api-version=2017-04-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003","name":"cliAutho000003","type":"Microsoft.Relay/Namespaces/AuthorizationRules","location":"West + US 2","properties":{"rights":["Send"]}}'} + headers: + cache-control: [no-cache] + content-length: ['390'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:48:19 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace authorizationrule show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003?api-version=2017-04-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003","name":"cliAutho000003","type":"Microsoft.Relay/Namespaces/AuthorizationRules","location":"West + US 2","properties":{"rights":["Send"]}}'} + headers: + cache-control: [no-cache] + content-length: ['390'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:48:21 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace authorizationrule show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/RootManageSharedAccessKey?api-version=2017-04-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/RootManageSharedAccessKey","name":"RootManageSharedAccessKey","type":"Microsoft.Relay/Namespaces/AuthorizationRules","location":"West + US 2","properties":{"rights":["Listen","Manage","Send"]}}'} + headers: + cache-control: [no-cache] + content-length: ['418'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:48:21 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace authorizationrule keys list] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003/listKeys?api-version=2017-04-01 + response: + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=mjnfAGudf8bRxq7BhGu83MeW5YOQX55IoWnD3VkE9UU=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=U4psv1w+MsET5lU++1V/lJ3syEw7FkJ+wsrAgF0msk0=","primaryKey":"mjnfAGudf8bRxq7BhGu83MeW5YOQX55IoWnD3VkE9UU=","secondaryKey":"U4psv1w+MsET5lU++1V/lJ3syEw7FkJ+wsrAgF0msk0=","keyName":"cliAutho000003"}'} + headers: + cache-control: [no-cache] + content-length: ['536'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:48:22 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: '{"keyType": "PrimaryKey"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace authorizationrule keys renew] + Connection: [keep-alive] + Content-Length: ['25'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01 + response: + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=Pu9XIVjXC3OIMe1zMs9PvW55hHIHADWglFOXewHXgZ0=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=U4psv1w+MsET5lU++1V/lJ3syEw7FkJ+wsrAgF0msk0=","primaryKey":"Pu9XIVjXC3OIMe1zMs9PvW55hHIHADWglFOXewHXgZ0=","secondaryKey":"U4psv1w+MsET5lU++1V/lJ3syEw7FkJ+wsrAgF0msk0=","keyName":"cliAutho000003"}'} + headers: + cache-control: [no-cache] + content-length: ['536'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:48:38 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: '{"keyType": "SecondaryKey"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace authorizationrule keys renew] + Connection: [keep-alive] + Content-Length: ['27'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01 + response: + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=Pu9XIVjXC3OIMe1zMs9PvW55hHIHADWglFOXewHXgZ0=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=GfcRi/6BMWO2TljEdGa/KJt2gVIx2xQaAPGu0YmwwoM=","primaryKey":"Pu9XIVjXC3OIMe1zMs9PvW55hHIHADWglFOXewHXgZ0=","secondaryKey":"GfcRi/6BMWO2TljEdGa/KJt2gVIx2xQaAPGu0YmwwoM=","keyName":"cliAutho000003"}'} + headers: + cache-control: [no-cache] + content-length: ['536'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:48:55 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace authorizationrule delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003?api-version=2017-04-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:49:12 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:49:12 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace delete] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:49:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_eh_namespace000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:49:45 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGRUg6NUZOQU1FU1BBQ0U0SFgzNkZCTkROQ01DS1ZXWEc2WHw1NkY3RERDNEU0NkQzNDBDLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml b/src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml new file mode 100644 index 00000000000..99b5e01da40 --- /dev/null +++ b/src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml @@ -0,0 +1,494 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_relay_wcfrelay000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001","name":"cli_test_relay_wcfrelay000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:49:45 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + status: {code: 201, message: Created} +- request: + body: '{"location": "westus2", "tags": {"{tag2: value2,": "", "tag1: value1}": + ""}, "sku": {"name": "Standard", "tier": "Standard"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace create] + Connection: [keep-alive] + Content-Length: ['125'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:49:46.557Z","updatedAt":"2018-02-06T00:49:46.557Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} + headers: + cache-control: [no-cache] + content-length: ['686'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:49:48 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace create] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:49:46.557Z","updatedAt":"2018-02-06T00:50:08.953Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + headers: + cache-control: [no-cache] + content-length: ['684'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:50:18 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:49:46.557Z","updatedAt":"2018-02-06T00:50:08.953Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + headers: + cache-control: [no-cache] + content-length: ['684'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:50:19 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: '{"properties": {"relayType": "NetTcp", "requiresClientAuthorization": true, + "requiresTransportSecurity": true, "userMetadata": "UserMetadata"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay wcfrelay create] + Connection: [keep-alive] + Content-Length: ['143'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004?api-version=2017-04-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004","name":"relay-wcfrelaycli000004","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West + US 2","properties":{"createdAt":"2018-02-06T00:50:23.1574549Z","updatedAt":"2018-02-06T00:50:23.1574549Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}'} + headers: + cache-control: [no-cache] + content-length: ['605'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:50:22 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay wcfrelay show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004?api-version=2017-04-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004","name":"relay-wcfrelaycli000004","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West + US 2","properties":{"createdAt":"2018-02-06T00:50:23.1574549Z","updatedAt":"2018-02-06T00:50:23.1574549Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}'} + headers: + cache-control: [no-cache] + content-length: ['605'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:50:23 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay wcfrelay list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays?api-version=2017-04-01 + response: + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004","name":"relay-wcfrelaycli000004","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West + US 2","properties":{"createdAt":"2018-02-06T00:50:23.1574549Z","updatedAt":"2018-02-06T00:50:23.1574549Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}]}'} + headers: + cache-control: [no-cache] + content-length: ['617'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:50:24 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-inline-count: [''] + status: {code: 200, message: OK} +- request: + body: '{"properties": {"rights": ["Listen"]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay wcfrelay authorizationrule create] + Connection: [keep-alive] + Content-Length: ['38'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005?api-version=2017-04-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005","name":"cliwcfrelayAutho000005","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West + US 2","properties":{"rights":["Listen"]}}'} + headers: + cache-control: [no-cache] + content-length: ['448'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:50:26 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay wcfrelay authorizationrule show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005?api-version=2017-04-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005","name":"cliwcfrelayAutho000005","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West + US 2","properties":{"rights":["Listen"]}}'} + headers: + cache-control: [no-cache] + content-length: ['448'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:50:26 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay wcfrelay authorizationrule keys list] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005/listKeys?api-version=2017-04-01 + response: + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=DPEvoUAUuzodIpDCty7TfcRbnzUE1PRQl4w+8pgPTQQ=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=wlrCCExtDCeJDU5UDDMbn6XxrF3GElo6s0HZvCf8ng8=;EntityPath=relay-wcfrelaycli000004","primaryKey":"DPEvoUAUuzodIpDCty7TfcRbnzUE1PRQl4w+8pgPTQQ=","secondaryKey":"wlrCCExtDCeJDU5UDDMbn6XxrF3GElo6s0HZvCf8ng8=","keyName":"cliwcfrelayAutho000005"}'} + headers: + cache-control: [no-cache] + content-length: ['625'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:50:27 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: '{"keyType": "PrimaryKey"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay wcfrelay authorizationrule keys renew] + Connection: [keep-alive] + Content-Length: ['25'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005/regenerateKeys?api-version=2017-04-01 + response: + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=Pskc1NQ/vTKSHFPQERPMyEkwLL4riJfvdoun7sM/eoo=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=wlrCCExtDCeJDU5UDDMbn6XxrF3GElo6s0HZvCf8ng8=;EntityPath=relay-wcfrelaycli000004","primaryKey":"Pskc1NQ/vTKSHFPQERPMyEkwLL4riJfvdoun7sM/eoo=","secondaryKey":"wlrCCExtDCeJDU5UDDMbn6XxrF3GElo6s0HZvCf8ng8=","keyName":"cliwcfrelayAutho000005"}'} + headers: + cache-control: [no-cache] + content-length: ['625'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:50:28 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: '{"keyType": "SecondaryKey"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay wcfrelay authorizationrule keys renew] + Connection: [keep-alive] + Content-Length: ['27'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005/regenerateKeys?api-version=2017-04-01 + response: + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=Pskc1NQ/vTKSHFPQERPMyEkwLL4riJfvdoun7sM/eoo=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=nNlT1/r6EBBuYw5mLAhNR25ThZJJ3Fwkf0rmBKE0NEs=;EntityPath=relay-wcfrelaycli000004","primaryKey":"Pskc1NQ/vTKSHFPQERPMyEkwLL4riJfvdoun7sM/eoo=","secondaryKey":"nNlT1/r6EBBuYw5mLAhNR25ThZJJ3Fwkf0rmBKE0NEs=","keyName":"cliwcfrelayAutho000005"}'} + headers: + cache-control: [no-cache] + content-length: ['625'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 06 Feb 2018 00:50:29 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay wcfrelay authorizationrule delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005?api-version=2017-04-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:50:29 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay wcfrelay delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004?api-version=2017-04-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:50:31 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:50:32 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [relay namespace delete] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:51:02 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] + server-sb: [Service-Bus-Resource-Provider/SN1] + strict-transport-security: [max-age=31536000; includeSubDomains] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_relay_wcfrelay000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Tue, 06 Feb 2018 00:51:05 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkVMQVk6NUZXQ0ZSRUxBWTdCQVdWUVAyVFZBU05aVDdERnw3MDY5NTUzMTE0M0Q5NzI2LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/relay/azext_relay/tests/test_relay_commands.py b/src/relay/azext_relay/tests/test_relay_commands.py new file mode 100644 index 00000000000..4a73d983691 --- /dev/null +++ b/src/relay/azext_relay/tests/test_relay_commands.py @@ -0,0 +1,228 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# AZURE CLI Relay - NAMESPACE TEST DEFINITIONS + +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) + + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + + +class RelayScenarioTest(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test_eh_namespace') + def test_relay_namespace(self, resource_group): + self.kwargs.update({ + 'loc': 'westus2', + 'rg': resource_group, + 'namespacename': self.create_random_name(prefix='relay-nscli', length=20), + 'tags': {'tag1: value1'}, + 'sku': 'Standard', + 'tier': 'Standard', + 'authoname': self.create_random_name(prefix='cliAutho', length=20), + 'defaultauthorizationrule': 'RootManageSharedAccessKey', + 'accessrights': 'Send', + 'primary': 'PrimaryKey', + 'secondary': 'SecondaryKey' + }) + + # Check for the NameSpace name Availability + + self.cmd('relay namespace exists --name {namespacename}', + checks=[self.check('nameAvailable', True)]) + + # Create Namespace + self.cmd( + 'relay namespace create --resource-group {rg} --name {namespacename} --location {loc} --tags {tags} --sku-tier {tier}', + checks=[self.check('sku.tier', self.kwargs['tier'])]) + + # Get Created Namespace + self.cmd('relay namespace show --resource-group {rg} --name {namespacename}', + checks=[self.check('sku.tier', self.kwargs['tier'])]) + + # Get Created Namespace list by subscription + listnamespaceresult = self.cmd('relay namespace list').output + self.assertGreater(len(listnamespaceresult), 0) + + # Get Created Namespace list by ResourceGroup + listnamespacebyresourcegroupresult = self.cmd('relay namespace list --resource-group {rg}').output + self.assertGreater(len(listnamespacebyresourcegroupresult), 0) + + # Create Authoriazation Rule + self.cmd( + 'relay namespace authorizationrule create --resource-group {rg} --namespace-name {namespacename} --name {authoname} --access-rights {accessrights}', + checks=[self.check('name', self.kwargs['authoname'])]) + + # Get Authorization Rule + self.cmd( + 'relay namespace authorizationrule show --resource-group {rg} --namespace-name {namespacename} --name {authoname}', + checks=[self.check('name', self.kwargs['authoname'])]) + + # Get Default Authorization Rule + self.cmd( + 'relay namespace authorizationrule show --resource-group {rg} --namespace-name {namespacename} --name {defaultauthorizationrule}', + checks=[self.check('name', self.kwargs['defaultauthorizationrule'])]) + + # Get Authorization Rule Listkeys + self.cmd( + 'relay namespace authorizationrule keys list --resource-group {rg} --namespace-name {namespacename} --name {authoname}') + + # Regeneratekeys - Primary + self.cmd( + 'relay namespace authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --name {authoname} --key-name {primary}') + + # Regeneratekeys - Secondary + self.cmd( + 'relay namespace authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --name {authoname} --key-name {secondary}') + + # Delete AuthorizationRule + self.cmd( + 'relay namespace authorizationrule delete --resource-group {rg} --namespace-name {namespacename} --name {authoname}') + + # Delete Namespace list by ResourceGroup + self.cmd('relay namespace delete --resource-group {rg} --name {namespacename}') + + @ResourceGroupPreparer(name_prefix='cli_test_relay_wcfrelay') + def test_relay_wcfrelay(self, resource_group): + self.kwargs.update({ + 'loc': 'westus2', + 'rg': resource_group, + 'namespacename': self.create_random_name(prefix='relay-nscli', length=20), + 'tags': {'tag1: value1', 'tag2: value2'}, + 'sku': 'Standard', + 'tier': 'Standard', + 'authoname': self.create_random_name(prefix='cliAutho', length=20), + 'defaultauthorizationrule': 'RootManageSharedAccessKey', + 'accessrights': 'Listen', + 'primary': 'PrimaryKey', + 'secondary': 'SecondaryKey', + 'wcfrelayname': self.create_random_name(prefix='relay-wcfrelaycli', length=25), + 'wcfrelayauthoname': self.create_random_name(prefix='cliwcfrelayAutho', length=25), + 'requiresclientauthorization': 'True', + 'requirestransportsecurity': 'True', + 'usermetadata': 'UserMetadata', + 'relaytype': 'NetTcp' + }) + + # Create Namespace + self.cmd( + 'relay namespace create --resource-group {rg} --name {namespacename} --location {loc} --tags {tags} --sku-tier {tier}', + checks=[self.check('sku.tier', self.kwargs['tier'])]) + + # Get Created Namespace + self.cmd('relay namespace show --resource-group {rg} --name {namespacename}', + checks=[self.check('sku.tier', self.kwargs['tier'])]) + + # Create WCFRelay + self.cmd( + 'relay wcfrelay create --resource-group {rg} --namespace-name {namespacename} --name {wcfrelayname} --relay-type {relaytype} --requires-client-authorization {requiresclientauthorization} --requires-transport-security {requirestransportsecurity} --user-metadata {usermetadata}', + checks=[self.check('name', self.kwargs['wcfrelayname'])]) + + # Get WCFRelay + self.cmd('relay wcfrelay show --resource-group {rg} --namespace-name {namespacename} --name {wcfrelayname}', + checks=[self.check('name', self.kwargs['wcfrelayname'])]) + + # WCFRelay List + listwcfrelay = self.cmd('relay wcfrelay list --resource-group {rg} --namespace-name {namespacename}').output + self.assertGreater(len(listwcfrelay), 0) + + # Create Authoriazation Rule + self.cmd( + 'relay wcfrelay authorizationrule create --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname} --access-rights {accessrights}', + checks=[self.check('name', self.kwargs['wcfrelayauthoname'])]) + + # Get Create Authorization Rule + self.cmd( + 'relay wcfrelay authorizationrule show --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname}', + checks=[self.check('name', self.kwargs['wcfrelayauthoname'])]) + + # Get Authorization Rule Listkeys + self.cmd( + 'relay wcfrelay authorizationrule keys list --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname}') + + # Regeneratekeys - Primary + regenrateprimarykeyresult = self.cmd( + 'relay wcfrelay authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname} --key-name {primary}') + self.assertIsNotNone(regenrateprimarykeyresult) + + # Regeneratekeys - Secondary + regenratesecondarykeyresult = self.cmd( + 'relay wcfrelay authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname} --key-name {secondary}') + self.assertIsNotNone(regenratesecondarykeyresult) + + # Delete WCFRelay AuthorizationRule + self.cmd( + 'relay wcfrelay authorizationrule delete --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname}') + + # Delete WCFRelay + self.cmd('relay wcfrelay delete --resource-group {rg} --namespace-name {namespacename} --name {wcfrelayname}') + + # Delete Namespace + self.cmd('relay namespace delete --resource-group {rg} --name {namespacename}') + + @ResourceGroupPreparer(name_prefix='cli_test_relay_hybridconnection') + def test_relay_hybridconnection(self, resource_group): + self.kwargs.update({ + 'loc': 'westus2', + 'rg': resource_group, + 'namespacename': self.create_random_name(prefix='relay-nscli', length=20), + 'tags': {'tag1: value1', 'tag2: value2'}, + 'sku': 'Standard', + 'tier': 'Standard', + 'authoname': self.create_random_name(prefix='cliAutho', length=20), + 'defaultauthorizationrule': 'RootManageSharedAccessKey', + 'accessrights': 'Listen', + 'primary': 'PrimaryKey', + 'secondary': 'SecondaryKey', + 'hybridconnectionname': self.create_random_name(prefix='relay-hybridcli', length=25), + 'hybridconnectionauthoname': self.create_random_name(prefix='clihybridAutho', length=25), + 'requiresclientauthorization': 'True', + 'usermetadata': 'UserMetadata' + }) + + # Create Namespace + self.cmd('relay namespace create --resource-group {rg} --name {namespacename} --location {loc} --tags {tags} --sku-tier {tier}', + checks=[self.check('sku.tier', self.kwargs['tier'])]) + + # Get Created Namespace + self.cmd('relay namespace show --resource-group {rg} --name {namespacename}', + checks=[self.check('sku.tier', self.kwargs['tier'])]) + + # Create Hybrid Connections + self.cmd('relay hybrid-connections create --resource-group {rg} --namespace-name {namespacename} --name {hybridconnectionname} --requires-client-authorization {requiresclientauthorization} --user-metadata {usermetadata}', checks=[self.check('name', self.kwargs['hybridconnectionname'])]) + + # Get Hybrid Connections + self.cmd('relay hybrid-connections show --resource-group {rg} --namespace-name {namespacename} --name {hybridconnectionname}', checks=[self.check('name', self.kwargs['hybridconnectionname'])]) + + # Hybrid Connections List + listhybirdconnection = self.cmd('relay hybrid-connections list --resource-group {rg} --namespace-name {namespacename}').output + self.assertGreater(len(listhybirdconnection), 0) + + # Create Authoriazation Rule + self.cmd('relay hybrid-connections authorizationrule create --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname} --access-rights {accessrights}', checks=[self.check('name', self.kwargs['hybridconnectionauthoname'])]) + + # Get Create Authorization Rule + self.cmd('relay hybrid-connections authorizationrule show --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname}', checks=[self.check('name', self.kwargs['hybridconnectionauthoname'])]) + + # Get Authorization Rule Listkeys + self.cmd('relay hybrid-connections authorizationrule keys list --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname}') + + # Regeneratekeys - Primary + regenrateprimarykeyresult = self.cmd('relay hybrid-connections authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname} --key-name {primary}') + self.assertIsNotNone(regenrateprimarykeyresult) + + # Regeneratekeys - Secondary + regenratesecondarykeyresult = self.cmd('relay hybrid-connections authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname} --key-name {secondary}') + self.assertIsNotNone(regenratesecondarykeyresult) + + # Delete Hybrid Connections AuthorizationRule + self.cmd('relay hybrid-connections authorizationrule delete --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname}') + + # Delete Hybrid Connections + self.cmd('relay hybrid-connections delete --resource-group {rg} --namespace-name {namespacename} --name {hybridconnectionname}') + + # Delete Namespace + self.cmd('relay namespace delete --resource-group {rg} --name {namespacename}') diff --git a/src/relay/setup.cfg b/src/relay/setup.cfg new file mode 100644 index 00000000000..3c6e79cf31d --- /dev/null +++ b/src/relay/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/src/relay/setup.py b/src/relay/setup.py new file mode 100644 index 00000000000..f5d91e22732 --- /dev/null +++ b/src/relay/setup.py @@ -0,0 +1,41 @@ +#!/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 + +VERSION = "0.0.1" + +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +setup( + name='relay', + version=VERSION, + description='An Azure CLI Extension to manage Relay resources', + long_description='An Azure CLI Extension to manage Relay resources', + license='MIT', + author='Ajit Navasare', + author_email='v-ajnava@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions', + classifiers=CLASSIFIERS, + packages=find_packages(exclude=["tests"]), + install_requires=DEPENDENCIES +) From a5aca4e3ce25a616c0e289657812e8f457fe0fb0 Mon Sep 17 00:00:00 2001 From: "Ajit Maruti Navasare (MINDTREE LIMITED)" Date: Tue, 6 Feb 2018 10:27:52 -0800 Subject: [PATCH 2/3] updated recordings and lint fix --- src/relay/azext_relay/custom.py | 1 - .../test_relay_hybridconnection.yaml | 70 ++++++++-------- .../recordings/test_relay_namespace.yaml | 68 ++++++++-------- .../tests/recordings/test_relay_wcfrelay.yaml | 80 +++++++++---------- 4 files changed, 109 insertions(+), 110 deletions(-) diff --git a/src/relay/azext_relay/custom.py b/src/relay/azext_relay/custom.py index c3fc75c2961..faacee90aa0 100644 --- a/src/relay/azext_relay/custom.py +++ b/src/relay/azext_relay/custom.py @@ -60,7 +60,6 @@ def cli_hybridconnectionsautho_create(client, resource_group_name, namespace_nam accessrights_converter(access_rights)) - # pylint: disable=inconsistent-return-statements def empty_on_404(ex): from azext_relay.relay.models import ErrorResponseException diff --git a/src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml b/src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml index 259338fce64..b2db5c31e0c 100644 --- a/src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml +++ b/src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml @@ -20,14 +20,14 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:45:54 GMT'] + date: ['Tue, 06 Feb 2018 18:18:20 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 201, message: Created} - request: - body: '{"location": "westus2", "tags": {"{tag2: value2,": "", "tag1: value1}": + body: '{"location": "westus2", "tags": {"{tag1: value1,": "", "tag2: value2}": ""}, "sku": {"name": "Standard", "tier": "Standard"}}' headers: Accept: [application/json] @@ -43,12 +43,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:45:55.403Z","updatedAt":"2018-02-06T00:45:55.403Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} + US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:18:20.113Z","updatedAt":"2018-02-06T18:18:20.113Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} headers: cache-control: [no-cache] content-length: ['686'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:45:56 GMT'] + date: ['Tue, 06 Feb 2018 18:18:21 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -73,12 +73,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:45:55.403Z","updatedAt":"2018-02-06T00:46:20.813Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:18:20.113Z","updatedAt":"2018-02-06T18:18:44.957Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] content-length: ['684'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:46:26 GMT'] + date: ['Tue, 06 Feb 2018 18:18:52 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -102,12 +102,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:45:55.403Z","updatedAt":"2018-02-06T00:46:20.813Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:18:20.113Z","updatedAt":"2018-02-06T18:18:44.957Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] content-length: ['684'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:46:28 GMT'] + date: ['Tue, 06 Feb 2018 18:18:53 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -132,12 +132,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004","name":"relay-hybridcli000004","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West - US 2","properties":{"createdAt":"2018-02-06T00:46:30.907445Z","updatedAt":"2018-02-06T00:46:30.907445Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}'} + US 2","properties":{"createdAt":"2018-02-06T18:18:57.6743415Z","updatedAt":"2018-02-06T18:18:57.6743415Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}'} headers: cache-control: [no-cache] - content-length: ['547'] + content-length: ['549'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:46:30 GMT'] + date: ['Tue, 06 Feb 2018 18:18:57 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -162,12 +162,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004","name":"relay-hybridcli000004","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West - US 2","properties":{"createdAt":"2018-02-06T00:46:30.907445Z","updatedAt":"2018-02-06T00:46:30.907445Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}'} + US 2","properties":{"createdAt":"2018-02-06T18:18:57.6743415Z","updatedAt":"2018-02-06T18:18:57.6743415Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}'} headers: cache-control: [no-cache] - content-length: ['547'] + content-length: ['549'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:46:31 GMT'] + date: ['Tue, 06 Feb 2018 18:18:58 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -191,12 +191,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections?api-version=2017-04-01 response: body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004","name":"relay-hybridcli000004","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West - US 2","properties":{"createdAt":"2018-02-06T00:46:30.907445Z","updatedAt":"2018-02-06T00:46:30.907445Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}]}'} + US 2","properties":{"createdAt":"2018-02-06T18:18:57.6743415Z","updatedAt":"2018-02-06T18:18:57.6743415Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}]}'} headers: cache-control: [no-cache] - content-length: ['559'] + content-length: ['561'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:46:32 GMT'] + date: ['Tue, 06 Feb 2018 18:18:59 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -227,7 +227,7 @@ interactions: cache-control: [no-cache] content-length: ['464'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:46:33 GMT'] + date: ['Tue, 06 Feb 2018 18:19:00 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -235,7 +235,7 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: body: null @@ -257,7 +257,7 @@ interactions: cache-control: [no-cache] content-length: ['464'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:46:34 GMT'] + date: ['Tue, 06 Feb 2018 18:19:01 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -281,12 +281,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005/listKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=m8u3AoirNXZ6VECJShOs3yRWczAM9VKh3hm6N07T5j4=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=nLe5el7LrlLGMZALWp94xhSv5UYamcLw2V8KwRRkKgA=;EntityPath=relay-hybridcli000004","primaryKey":"m8u3AoirNXZ6VECJShOs3yRWczAM9VKh3hm6N07T5j4=","secondaryKey":"nLe5el7LrlLGMZALWp94xhSv5UYamcLw2V8KwRRkKgA=","keyName":"clihybridAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=LA3u6Y0BeLNOI+Yw/tQX22/Yt+4LaaytCnTL30iZoC0=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=HJf40Bd9aJo979nczVdsNghQeUbLV8LARpFIlbND6CE=;EntityPath=relay-hybridcli000004","primaryKey":"LA3u6Y0BeLNOI+Yw/tQX22/Yt+4LaaytCnTL30iZoC0=","secondaryKey":"HJf40Bd9aJo979nczVdsNghQeUbLV8LARpFIlbND6CE=","keyName":"clihybridAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:46:34 GMT'] + date: ['Tue, 06 Feb 2018 18:19:01 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -311,12 +311,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=CM9OfgXztuss5egm5EPidJenQ40g0/K5pDGJHXHwiM8=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=nLe5el7LrlLGMZALWp94xhSv5UYamcLw2V8KwRRkKgA=;EntityPath=relay-hybridcli000004","primaryKey":"CM9OfgXztuss5egm5EPidJenQ40g0/K5pDGJHXHwiM8=","secondaryKey":"nLe5el7LrlLGMZALWp94xhSv5UYamcLw2V8KwRRkKgA=","keyName":"clihybridAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=aqyRY6SB3lh5wI0KX1kAieTC87cseUyA1qnfGAvt5uw=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=HJf40Bd9aJo979nczVdsNghQeUbLV8LARpFIlbND6CE=;EntityPath=relay-hybridcli000004","primaryKey":"aqyRY6SB3lh5wI0KX1kAieTC87cseUyA1qnfGAvt5uw=","secondaryKey":"HJf40Bd9aJo979nczVdsNghQeUbLV8LARpFIlbND6CE=","keyName":"clihybridAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:46:34 GMT'] + date: ['Tue, 06 Feb 2018 18:19:02 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -324,7 +324,7 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: body: '{"keyType": "SecondaryKey"}' @@ -341,12 +341,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=CM9OfgXztuss5egm5EPidJenQ40g0/K5pDGJHXHwiM8=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=8ZVOee0sJyqFU6pU3CdcWbJRpOGdZlnySMbtJaU04OA=;EntityPath=relay-hybridcli000004","primaryKey":"CM9OfgXztuss5egm5EPidJenQ40g0/K5pDGJHXHwiM8=","secondaryKey":"8ZVOee0sJyqFU6pU3CdcWbJRpOGdZlnySMbtJaU04OA=","keyName":"clihybridAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=aqyRY6SB3lh5wI0KX1kAieTC87cseUyA1qnfGAvt5uw=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=to118zbkBieq+AfOK+gciOROEAG0Lu/nH52/sLiu9Jc=;EntityPath=relay-hybridcli000004","primaryKey":"aqyRY6SB3lh5wI0KX1kAieTC87cseUyA1qnfGAvt5uw=","secondaryKey":"to118zbkBieq+AfOK+gciOROEAG0Lu/nH52/sLiu9Jc=","keyName":"clihybridAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:46:36 GMT'] + date: ['Tue, 06 Feb 2018 18:19:03 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -375,13 +375,13 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:46:37 GMT'] + date: ['Tue, 06 Feb 2018 18:19:04 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] server-sb: [Service-Bus-Resource-Provider/SN1] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: body: null @@ -402,7 +402,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:46:38 GMT'] + date: ['Tue, 06 Feb 2018 18:19:06 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -429,14 +429,14 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:46:40 GMT'] + date: ['Tue, 06 Feb 2018 18:19:07 GMT'] expires: ['-1'] location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] server-sb: [Service-Bus-Resource-Provider/SN1] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} - request: body: null @@ -456,7 +456,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:47:09 GMT'] + date: ['Tue, 06 Feb 2018 18:19:37 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -483,9 +483,9 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:47:12 GMT'] + date: ['Tue, 06 Feb 2018 18:19:39 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkVMQVk6NUZIWUJSSURDT05ORUNUSU9ONkgyTkVKM1BYQXwxMUNGNkJFREYzREY1NTExLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkVMQVk6NUZIWUJSSURDT05ORUNUSU9OQlZDMjNWNEFXRHxGRjlDMkE2RTY4MTVEMTQ0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-ms-ratelimit-remaining-subscription-writes: ['1199'] diff --git a/src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml b/src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml index 456d655f132..37cde91b2b7 100644 --- a/src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml +++ b/src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml @@ -20,7 +20,7 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:47:13 GMT'] + date: ['Tue, 06 Feb 2018 18:19:40 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -46,7 +46,7 @@ interactions: cache-control: [no-cache] content-length: ['53'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:47:13 GMT'] + date: ['Tue, 06 Feb 2018 18:19:40 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -73,12 +73,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:47:14.437Z","updatedAt":"2018-02-06T00:47:14.437Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:19:40.797Z","updatedAt":"2018-02-06T18:19:40.797Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} headers: cache-control: [no-cache] content-length: ['667'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:47:15 GMT'] + date: ['Tue, 06 Feb 2018 18:19:42 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -103,12 +103,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:47:14.437Z","updatedAt":"2018-02-06T00:47:39.947Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:19:40.797Z","updatedAt":"2018-02-06T18:20:06.373Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] content-length: ['665'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:47:45 GMT'] + date: ['Tue, 06 Feb 2018 18:20:12 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -132,12 +132,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:47:14.437Z","updatedAt":"2018-02-06T00:47:39.947Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:19:40.797Z","updatedAt":"2018-02-06T18:20:06.373Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] content-length: ['665'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:47:46 GMT'] + date: ['Tue, 06 Feb 2018 18:20:13 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -160,18 +160,18 @@ interactions: method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Relay/namespaces?api-version=2017-04-01 response: - body: {string: '{"value":[{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SDKTests/providers/Microsoft.Relay/namespaces/TestingIgniteNamespaceRelay","name":"TestingIgniteNamespaceRelay","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingignitenamespacerelay","createdAt":"2017-09-22T23:10:13.723Z","updatedAt":"2017-09-22T23:11:10.827Z","serviceBusEndpoint":"https://TestingIgniteNamespaceRelay.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_alias2mv7ov6fsgikow24xobpownip4z7mijgbqjghkrz5zav4njw5lcf6lf7px/providers/Microsoft.Relay/namespaces/testingrelay1","name":"testingrelay1","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tage":"value1"},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingrelay1","createdAt":"2018-02-05T18:09:29.373Z","updatedAt":"2018-02-05T18:09:57.353Z","serviceBusEndpoint":"https://testingrelay1.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_alias2mv7ov6fsgikow24xobpownip4z7mijgbqjghkrz5zav4njw5lcf6lf7px/providers/Microsoft.Relay/namespaces/TestingRelay99","name":"TestingRelay99","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingrelay99","createdAt":"2018-02-05T22:40:33.257Z","updatedAt":"2018-02-05T22:41:00.467Z","serviceBusEndpoint":"https://TestingRelay99.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.Relay/namespaces/RelayTest1234","name":"RelayTest1234","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relaytest1234","createdAt":"2017-04-26T00:38:15.667Z","updatedAt":"2017-08-25T02:09:28.613Z","serviceBusEndpoint":"https://RelayTest1234.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:47:14.437Z","updatedAt":"2018-02-06T00:47:39.947Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RGName-onesdk9880/providers/Microsoft.Relay/namespaces/testingnamespaceforwcfRelay","name":"testingnamespaceforwcfRelay","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingnamespaceforwcfrelay","createdAt":"2017-11-10T18:07:19.713Z","updatedAt":"2017-11-10T18:07:45.843Z","serviceBusEndpoint":"https://testingnamespaceforwcfRelay.servicebus.windows.net:443/","status":"Active"}}]}'} + body: {string: '{"value":[{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_alias2mv7ov6fsgikow24xobpownip4z7mijgbqjghkrz5zav4njw5lcf6lf7px/providers/Microsoft.Relay/namespaces/TestingRelay99","name":"TestingRelay99","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingrelay99","createdAt":"2018-02-05T22:40:33.257Z","updatedAt":"2018-02-05T22:41:00.467Z","serviceBusEndpoint":"https://TestingRelay99.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SDKTests/providers/Microsoft.Relay/namespaces/TestingIgniteNamespaceRelay","name":"TestingIgniteNamespaceRelay","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingignitenamespacerelay","createdAt":"2017-09-22T23:10:13.723Z","updatedAt":"2017-09-22T23:11:10.827Z","serviceBusEndpoint":"https://TestingIgniteNamespaceRelay.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:19:40.797Z","updatedAt":"2018-02-06T18:20:06.373Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RGName-onesdk9880/providers/Microsoft.Relay/namespaces/testingnamespaceforwcfRelay","name":"testingnamespaceforwcfRelay","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingnamespaceforwcfrelay","createdAt":"2017-11-10T18:07:19.713Z","updatedAt":"2017-11-10T18:07:45.843Z","serviceBusEndpoint":"https://testingnamespaceforwcfRelay.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.Relay/namespaces/RelayTest1234","name":"RelayTest1234","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relaytest1234","createdAt":"2017-04-26T00:38:15.667Z","updatedAt":"2017-08-25T02:09:28.613Z","serviceBusEndpoint":"https://RelayTest1234.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_alias2mv7ov6fsgikow24xobpownip4z7mijgbqjghkrz5zav4njw5lcf6lf7px/providers/Microsoft.Relay/namespaces/testingrelay1","name":"testingrelay1","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{"tage":"value1"},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingrelay1","createdAt":"2018-02-05T18:09:29.373Z","updatedAt":"2018-02-05T18:09:57.353Z","serviceBusEndpoint":"https://testingrelay1.servicebus.windows.net:443/","status":"Active"}}]}'} headers: cache-control: [no-cache] content-length: ['3719'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:47:46 GMT'] + date: ['Tue, 06 Feb 2018 18:20:14 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -195,12 +195,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces?api-version=2017-04-01 response: body: {string: '{"value":[{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:47:14.437Z","updatedAt":"2018-02-06T00:47:39.947Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}]}'} + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:19:40.797Z","updatedAt":"2018-02-06T18:20:06.373Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}]}'} headers: cache-control: [no-cache] content-length: ['677'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:47:47 GMT'] + date: ['Tue, 06 Feb 2018 18:20:14 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -230,7 +230,7 @@ interactions: cache-control: [no-cache] content-length: ['390'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:48:19 GMT'] + date: ['Tue, 06 Feb 2018 18:20:47 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -260,7 +260,7 @@ interactions: cache-control: [no-cache] content-length: ['390'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:48:21 GMT'] + date: ['Tue, 06 Feb 2018 18:20:47 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -289,7 +289,7 @@ interactions: cache-control: [no-cache] content-length: ['418'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:48:21 GMT'] + date: ['Tue, 06 Feb 2018 18:20:48 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -313,12 +313,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003/listKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=mjnfAGudf8bRxq7BhGu83MeW5YOQX55IoWnD3VkE9UU=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=U4psv1w+MsET5lU++1V/lJ3syEw7FkJ+wsrAgF0msk0=","primaryKey":"mjnfAGudf8bRxq7BhGu83MeW5YOQX55IoWnD3VkE9UU=","secondaryKey":"U4psv1w+MsET5lU++1V/lJ3syEw7FkJ+wsrAgF0msk0=","keyName":"cliAutho000003"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=uY1GRjQzgeSyeJ3ObXTBjS5WWabAdpG559fTOKbw6ws=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=syAEy71/oWqvNlwadtk7LvQmB762YxlGG6OSYlQmpQs=","primaryKey":"uY1GRjQzgeSyeJ3ObXTBjS5WWabAdpG559fTOKbw6ws=","secondaryKey":"syAEy71/oWqvNlwadtk7LvQmB762YxlGG6OSYlQmpQs=","keyName":"cliAutho000003"}'} headers: cache-control: [no-cache] content-length: ['536'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:48:22 GMT'] + date: ['Tue, 06 Feb 2018 18:20:49 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -343,12 +343,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=Pu9XIVjXC3OIMe1zMs9PvW55hHIHADWglFOXewHXgZ0=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=U4psv1w+MsET5lU++1V/lJ3syEw7FkJ+wsrAgF0msk0=","primaryKey":"Pu9XIVjXC3OIMe1zMs9PvW55hHIHADWglFOXewHXgZ0=","secondaryKey":"U4psv1w+MsET5lU++1V/lJ3syEw7FkJ+wsrAgF0msk0=","keyName":"cliAutho000003"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=I7Ebez8OhXv6wu9duRKaiU0hN7TBkZeQw/Ry0MXeij0=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=syAEy71/oWqvNlwadtk7LvQmB762YxlGG6OSYlQmpQs=","primaryKey":"I7Ebez8OhXv6wu9duRKaiU0hN7TBkZeQw/Ry0MXeij0=","secondaryKey":"syAEy71/oWqvNlwadtk7LvQmB762YxlGG6OSYlQmpQs=","keyName":"cliAutho000003"}'} headers: cache-control: [no-cache] content-length: ['536'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:48:38 GMT'] + date: ['Tue, 06 Feb 2018 18:21:06 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -373,12 +373,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=Pu9XIVjXC3OIMe1zMs9PvW55hHIHADWglFOXewHXgZ0=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=GfcRi/6BMWO2TljEdGa/KJt2gVIx2xQaAPGu0YmwwoM=","primaryKey":"Pu9XIVjXC3OIMe1zMs9PvW55hHIHADWglFOXewHXgZ0=","secondaryKey":"GfcRi/6BMWO2TljEdGa/KJt2gVIx2xQaAPGu0YmwwoM=","keyName":"cliAutho000003"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=I7Ebez8OhXv6wu9duRKaiU0hN7TBkZeQw/Ry0MXeij0=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=B9qIrDVBLrxmgBVARe50GH6Op5dafl6BgEKOEumhur0=","primaryKey":"I7Ebez8OhXv6wu9duRKaiU0hN7TBkZeQw/Ry0MXeij0=","secondaryKey":"B9qIrDVBLrxmgBVARe50GH6Op5dafl6BgEKOEumhur0=","keyName":"cliAutho000003"}'} headers: cache-control: [no-cache] content-length: ['536'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:48:55 GMT'] + date: ['Tue, 06 Feb 2018 18:21:23 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -407,7 +407,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:49:12 GMT'] + date: ['Tue, 06 Feb 2018 18:21:39 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -434,14 +434,14 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:49:12 GMT'] + date: ['Tue, 06 Feb 2018 18:21:41 GMT'] expires: ['-1'] location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] server-sb: [Service-Bus-Resource-Provider/SN1] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1197'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 202, message: Accepted} - request: body: null @@ -461,7 +461,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:49:43 GMT'] + date: ['Tue, 06 Feb 2018 18:22:11 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -488,11 +488,11 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:49:45 GMT'] + date: ['Tue, 06 Feb 2018 18:22:13 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGRUg6NUZOQU1FU1BBQ0U0SFgzNkZCTkROQ01DS1ZXWEc2WHw1NkY3RERDNEU0NkQzNDBDLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGRUg6NUZOQU1FU1BBQ0VPVk1ZVk1BNVgyREY1M0NCWVZUNnxENjJFREE5ODA4N0FGMjA5LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml b/src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml index 99b5e01da40..7ec6c439714 100644 --- a/src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml +++ b/src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml @@ -20,14 +20,14 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:49:45 GMT'] + date: ['Tue, 06 Feb 2018 18:22:14 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1197'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 201, message: Created} - request: - body: '{"location": "westus2", "tags": {"{tag2: value2,": "", "tag1: value1}": + body: '{"location": "westus2", "tags": {"{tag1: value1,": "", "tag2: value2}": ""}, "sku": {"name": "Standard", "tier": "Standard"}}' headers: Accept: [application/json] @@ -43,12 +43,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:49:46.557Z","updatedAt":"2018-02-06T00:49:46.557Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} + US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:22:14.49Z","updatedAt":"2018-02-06T18:22:14.49Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} headers: cache-control: [no-cache] - content-length: ['686'] + content-length: ['684'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:49:48 GMT'] + date: ['Tue, 06 Feb 2018 18:22:16 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -56,7 +56,7 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: body: null @@ -73,12 +73,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:49:46.557Z","updatedAt":"2018-02-06T00:50:08.953Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:22:14.49Z","updatedAt":"2018-02-06T18:22:37.4Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] - content-length: ['684'] + content-length: ['681'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:50:18 GMT'] + date: ['Tue, 06 Feb 2018 18:22:47 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -102,12 +102,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T00:49:46.557Z","updatedAt":"2018-02-06T00:50:08.953Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:22:14.49Z","updatedAt":"2018-02-06T18:22:37.4Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] - content-length: ['684'] + content-length: ['681'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:50:19 GMT'] + date: ['Tue, 06 Feb 2018 18:22:47 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -133,12 +133,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004","name":"relay-wcfrelaycli000004","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West - US 2","properties":{"createdAt":"2018-02-06T00:50:23.1574549Z","updatedAt":"2018-02-06T00:50:23.1574549Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}'} + US 2","properties":{"createdAt":"2018-02-06T18:22:50.1225314Z","updatedAt":"2018-02-06T18:22:50.1225314Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}'} headers: cache-control: [no-cache] content-length: ['605'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:50:22 GMT'] + date: ['Tue, 06 Feb 2018 18:22:49 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -146,7 +146,7 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: body: null @@ -163,12 +163,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004","name":"relay-wcfrelaycli000004","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West - US 2","properties":{"createdAt":"2018-02-06T00:50:23.1574549Z","updatedAt":"2018-02-06T00:50:23.1574549Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}'} + US 2","properties":{"createdAt":"2018-02-06T18:22:50.1225314Z","updatedAt":"2018-02-06T18:22:50.1225314Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}'} headers: cache-control: [no-cache] content-length: ['605'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:50:23 GMT'] + date: ['Tue, 06 Feb 2018 18:22:51 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -192,12 +192,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays?api-version=2017-04-01 response: body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004","name":"relay-wcfrelaycli000004","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West - US 2","properties":{"createdAt":"2018-02-06T00:50:23.1574549Z","updatedAt":"2018-02-06T00:50:23.1574549Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}]}'} + US 2","properties":{"createdAt":"2018-02-06T18:22:50.1225314Z","updatedAt":"2018-02-06T18:22:50.1225314Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}]}'} headers: cache-control: [no-cache] content-length: ['617'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:50:24 GMT'] + date: ['Tue, 06 Feb 2018 18:22:51 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -228,7 +228,7 @@ interactions: cache-control: [no-cache] content-length: ['448'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:50:26 GMT'] + date: ['Tue, 06 Feb 2018 18:22:52 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -236,7 +236,7 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: body: null @@ -258,7 +258,7 @@ interactions: cache-control: [no-cache] content-length: ['448'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:50:26 GMT'] + date: ['Tue, 06 Feb 2018 18:22:52 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -282,12 +282,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005/listKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=DPEvoUAUuzodIpDCty7TfcRbnzUE1PRQl4w+8pgPTQQ=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=wlrCCExtDCeJDU5UDDMbn6XxrF3GElo6s0HZvCf8ng8=;EntityPath=relay-wcfrelaycli000004","primaryKey":"DPEvoUAUuzodIpDCty7TfcRbnzUE1PRQl4w+8pgPTQQ=","secondaryKey":"wlrCCExtDCeJDU5UDDMbn6XxrF3GElo6s0HZvCf8ng8=","keyName":"cliwcfrelayAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=7ExCuPAj5dpt7kRr7NXkNAyUPrHieP3LyL3V8pK8S9c=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=vV7G1Vo/6jNMenbjrSxFKH87nj6Reyw8rRJGGa7ac9o=;EntityPath=relay-wcfrelaycli000004","primaryKey":"7ExCuPAj5dpt7kRr7NXkNAyUPrHieP3LyL3V8pK8S9c=","secondaryKey":"vV7G1Vo/6jNMenbjrSxFKH87nj6Reyw8rRJGGa7ac9o=","keyName":"cliwcfrelayAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:50:27 GMT'] + date: ['Tue, 06 Feb 2018 18:22:53 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -295,7 +295,7 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: body: '{"keyType": "PrimaryKey"}' @@ -312,12 +312,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=Pskc1NQ/vTKSHFPQERPMyEkwLL4riJfvdoun7sM/eoo=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=wlrCCExtDCeJDU5UDDMbn6XxrF3GElo6s0HZvCf8ng8=;EntityPath=relay-wcfrelaycli000004","primaryKey":"Pskc1NQ/vTKSHFPQERPMyEkwLL4riJfvdoun7sM/eoo=","secondaryKey":"wlrCCExtDCeJDU5UDDMbn6XxrF3GElo6s0HZvCf8ng8=","keyName":"cliwcfrelayAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=IV5obExxGF7vhTujIikP51cAny630n/J/sMySuFKpU4=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=vV7G1Vo/6jNMenbjrSxFKH87nj6Reyw8rRJGGa7ac9o=;EntityPath=relay-wcfrelaycli000004","primaryKey":"IV5obExxGF7vhTujIikP51cAny630n/J/sMySuFKpU4=","secondaryKey":"vV7G1Vo/6jNMenbjrSxFKH87nj6Reyw8rRJGGa7ac9o=","keyName":"cliwcfrelayAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:50:28 GMT'] + date: ['Tue, 06 Feb 2018 18:22:54 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -325,7 +325,7 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} - request: body: '{"keyType": "SecondaryKey"}' @@ -342,12 +342,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=Pskc1NQ/vTKSHFPQERPMyEkwLL4riJfvdoun7sM/eoo=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=nNlT1/r6EBBuYw5mLAhNR25ThZJJ3Fwkf0rmBKE0NEs=;EntityPath=relay-wcfrelaycli000004","primaryKey":"Pskc1NQ/vTKSHFPQERPMyEkwLL4riJfvdoun7sM/eoo=","secondaryKey":"nNlT1/r6EBBuYw5mLAhNR25ThZJJ3Fwkf0rmBKE0NEs=","keyName":"cliwcfrelayAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=IV5obExxGF7vhTujIikP51cAny630n/J/sMySuFKpU4=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=/UYVY/nQsRtU0rYLax+oSwupymKcDYALmIj8KynwtMQ=;EntityPath=relay-wcfrelaycli000004","primaryKey":"IV5obExxGF7vhTujIikP51cAny630n/J/sMySuFKpU4=","secondaryKey":"/UYVY/nQsRtU0rYLax+oSwupymKcDYALmIj8KynwtMQ=","keyName":"cliwcfrelayAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 00:50:29 GMT'] + date: ['Tue, 06 Feb 2018 18:22:55 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -376,13 +376,13 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:50:29 GMT'] + date: ['Tue, 06 Feb 2018 18:22:56 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] server-sb: [Service-Bus-Resource-Provider/SN1] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} - request: body: null @@ -403,7 +403,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:50:31 GMT'] + date: ['Tue, 06 Feb 2018 18:22:57 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -430,14 +430,14 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:50:32 GMT'] + date: ['Tue, 06 Feb 2018 18:22:59 GMT'] expires: ['-1'] location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] server-sb: [Service-Bus-Resource-Provider/SN1] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} - request: body: null @@ -457,7 +457,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:51:02 GMT'] + date: ['Tue, 06 Feb 2018 18:23:29 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -484,11 +484,11 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 00:51:05 GMT'] + date: ['Tue, 06 Feb 2018 18:23:31 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkVMQVk6NUZXQ0ZSRUxBWTdCQVdWUVAyVFZBU05aVDdERnw3MDY5NTUzMTE0M0Q5NzI2LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkVMQVk6NUZXQ0ZSRUxBWUxSVkRJSUhURzM0QldMV0c3VHwyRTA3NzFFRjhDNkVFOEMwLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} version: 1 From b50c5fc5d6414fad8ddd3e8da79b7bbc2c696a7a Mon Sep 17 00:00:00 2001 From: "Ajit Maruti Navasare (MINDTREE LIMITED)" Date: Fri, 9 Feb 2018 18:26:00 -0800 Subject: [PATCH 3/3] Review comments resolved --- src/relay/azext_relay/__init__.py | 6 +- src/relay/azext_relay/_help.py | 108 +++++++------- src/relay/azext_relay/_params.py | 96 ++++++------- src/relay/azext_relay/commands.py | 8 +- src/relay/azext_relay/custom.py | 52 +++++-- .../test_relay_hybridconnection.yaml | 130 ++++++++--------- .../recordings/test_relay_namespace.yaml | 118 +++++++-------- .../tests/recordings/test_relay_wcfrelay.yaml | 136 +++++++++--------- .../azext_relay/tests/test_relay_commands.py | 52 +++---- 9 files changed, 362 insertions(+), 344 deletions(-) diff --git a/src/relay/azext_relay/__init__.py b/src/relay/azext_relay/__init__.py index 7d080557c3b..1e4361f4481 100644 --- a/src/relay/azext_relay/__init__.py +++ b/src/relay/azext_relay/__init__.py @@ -24,10 +24,8 @@ def load_command_table(self, args): return self.command_table def load_arguments(self, command): - from ._params import load_arguments_namespace, load_arguments_wcfrelay, load_arguments_hybridconnections - load_arguments_namespace(self, command) - load_arguments_wcfrelay(self, command) - load_arguments_hybridconnections(self, command) + from ._params import load_arguments_relayparams + load_arguments_relayparams(self, command) COMMAND_LOADER_CLS = RelayCommandsLoader diff --git a/src/relay/azext_relay/_help.py b/src/relay/azext_relay/_help.py index 9c9543e80e7..8386e067826 100644 --- a/src/relay/azext_relay/_help.py +++ b/src/relay/azext_relay/_help.py @@ -15,27 +15,27 @@ short-summary: Manage Azure Relay Namespace and AuthorizationRule """ -helps['relay namespace authorizationrule'] = """ +helps['relay namespace authorization-rule'] = """ type: group short-summary: Manage Azure Relay AuthorizationRule for Namespace """ -helps['relay namespace authorizationrule keys'] = """ +helps['relay namespace authorization-rule keys'] = """ type: group short-summary: Manage Azure Relay AuthorizationRule connection strings for Namespace """ -helps['relay wcfrelay'] = """ +helps['relay wcf-relay'] = """ type: group short-summary: Manage Azure Relay's WCF Relays and AuthorizationRule """ -helps['relay wcfrelay authorizationrule'] = """ +helps['relay wcf-relay authorization-rule'] = """ type: group short-summary: Manage Azure Relay AuthorizationRule for WCF Relay """ -helps['relay wcfrelay authorizationrule keys'] = """ +helps['relay wcf-relay authorization-rule keys'] = """ type: group short-summary: Manage Azure AuthorizationRule connection strings for WCF Relay """ @@ -45,12 +45,12 @@ short-summary: Manage Azure Relay's Hybrid Connections and AuthorizationRule """ -helps['relay hybrid-connections authorizationrule'] = """ +helps['relay hybrid-connections authorization-rule'] = """ type: group short-summary: Manage Azure Relay AuthorizationRule for Hybrid Connections """ -helps['relay hybrid-connections authorizationrule keys'] = """ +helps['relay hybrid-connections authorization-rule keys'] = """ type: group short-summary: Manage Azure AuthorizationRule connection strings for Hybrid Connections """ @@ -97,132 +97,132 @@ text: az relay namespace delete --resource-group myresourcegroup --name mynamespace """ -helps['relay namespace authorizationrule create'] = """ +helps['relay namespace authorization-rule create'] = """ type: command short-summary: Creates AuthorizationRule for the given Namespace examples: - name: Creates Authorization rules - text: az relay namespace authorizationrule create --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule --access-rights Send Listen + text: az relay namespace authorization-rule create --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule --access-rights Send Listen """ -helps['relay namespace authorizationrule show'] = """ +helps['relay namespace authorization-rule show'] = """ type: command short-summary: Shows the details of AuthorizationRule examples: - name: Shows the details of AuthorizationRule - text: az relay namespace authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule + text: az relay namespace authorization-rule show --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule """ -helps['relay namespace authorizationrule list'] = """ +helps['relay namespace authorization-rule list'] = """ type: command short-summary: Shows the list of AuthorizationRule by Namespace examples: - name: Shows the list of AuthorizationRule by Namespace - text: az relay namespace authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace + text: az relay namespace authorization-rule show --resource-group myresourcegroup --namespace-name mynamespace """ -helps['relay namespace authorizationrule keys list'] = """ +helps['relay namespace authorization-rule keys list'] = """ type: command short-summary: Shows the connection strings for namespace examples: - name: Shows the connectionstrings of AuthorizationRule for the namespace. - text: az relay namespace authorizationrule list-keys --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule + text: az relay namespace authorization-rule list-keys --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule """ -helps['relay namespace authorizationrule keys renew'] = """ +helps['relay namespace authorization-rule keys renew'] = """ type: command - short-summary: Regenerate the connectionstrings of AuthorizationRule for the namespace. + short-summary: Regenerate the connection strings of AuthorizationRule for the namespace. examples: - name: Regenerate the connectionstrings of AuthorizationRule for the namespace. - text: az relay namespace authorizationrule regenerate-keys --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule --key PrimaryKey + text: az relay namespace authorization-rule regenerate-keys --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule --key PrimaryKey """ -helps['relay namespace authorizationrule delete'] = """ +helps['relay namespace authorization-rule delete'] = """ type: command short-summary: Deletes the AuthorizationRule of the namespace. examples: - name: Deletes the AuthorizationRule of the namespace. - text: az relay namespace authorizationrule delete --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule + text: az relay namespace authorization-rule delete --resource-group myresourcegroup --namespace-name mynamespace --name myauthorule """ -helps['relay wcfrelay create'] = """ +helps['relay wcf-relay create'] = """ type: command short-summary: Creates the Relay's WCF Relays examples: - name: Create a new WCF Relays. - text: az relay wcfrelay create --resource-group myresourcegroup --namespace-name mynamespace --name mywcfrelay --relay-type NetTcp --requires-client-authorization true --requires-transport-security true --user-metadata 'User Metadata' + text: az relay wcf-relay create --resource-group myresourcegroup --namespace-name mynamespace --name mywcfrelay --relay-type NetTcp --requires-client-authorization true --requires-transport-security true --user-metadata 'User Metadata' """ -helps['relay wcfrelay show'] = """ +helps['relay wcf-relay show'] = """ type: command short-summary: shows the WCF Relays Details examples: - name: Shows the WCF Relays details. - text: az relay wcfrelay show --resource-group myresourcegroup --namespace-name mynamespace --name mywcfrelay + text: az relay wcf-relay show --resource-group myresourcegroup --namespace-name mynamespace --name mywcfrelay """ -helps['relay wcfrelay list'] = """ +helps['relay wcf-relay list'] = """ type: command short-summary: List the WCF Relays by Namepsace examples: - name: Get the WCF Relays by Namespace. - text: az relay wcfrelay list --resource-group myresourcegroup --namespace-name mynamespace + text: az relay wcf-relay list --resource-group myresourcegroup --namespace-name mynamespace """ -helps['relay wcfrelay delete'] = """ +helps['relay wcf-relay delete'] = """ type: command short-summary: Deletes the WCF Relays examples: - name: Deletes the WCF Relays - text: az relay wcfrelay delete --resource-group myresourcegroup --namespace-name mynamespace --name mywcfrelay + text: az relay wcf-relay delete --resource-group myresourcegroup --namespace-name mynamespace --name mywcfrelay """ -helps['relay wcfrelay authorizationrule create'] = """ +helps['relay wcf-relay authorization-rule create'] = """ type: command short-summary: Creates Authorization rule for the given WCF Relays examples: - name: Creates Authorization rules - text: az relay wcfrelay authorizationrule create --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule --access-rights Listen + text: az relay wcf-relay authorization-rule create --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule --access-rights Listen """ -helps['relay wcfrelay authorizationrule show'] = """ +helps['relay wcf-relay authorization-rule show'] = """ type: command short-summary: shows the details of AuthorizationRule examples: - name: shows the details of AuthorizationRule - text: az relay wcfrelay authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule + text: az relay wcf-relay authorization-rule show --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule """ -helps['relay wcfrelay authorizationrule list'] = """ +helps['relay wcf-relay authorization-rule list'] = """ type: command short-summary: shows the list of AuthorizationRule by WCF Relays examples: - name: shows the list of AuthorizationRule by WCF Relays - text: az relay wcfrelay authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay + text: az relay wcf-relay authorization-rule show --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay """ -helps['relay wcfrelay authorizationrule keys list'] = """ +helps['relay wcf-relay authorization-rule keys list'] = """ type: command short-summary: Shows the connection strings of AuthorizationRule for the WCF Relays. examples: - name: Shows the connection strings of AuthorizationRule for the WCF Relays. - text: az relay wcfrelay authorizationrule list-keys --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule + text: az relay wcf-relay authorization-rule list-keys --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule """ -helps['relay wcfrelay authorizationrule keys renew'] = """ +helps['relay wcf-relay authorization-rule keys renew'] = """ type: command short-summary: Regenerate the connection strings of AuthorizationRule for the namespace. examples: - name: Regenerate the connection strings of AuthorizationRule for the namespace. - text: az relay wcfrelay authorizationrule regenerate-keys --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule --key PrimaryKey + text: az relay wcf-relay authorization-rule regenerate-keys --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule --key PrimaryKey """ -helps['relay wcfrelay authorizationrule delete'] = """ +helps['relay wcf-relay authorization-rule delete'] = """ type: command short-summary: Deletes the AuthorizationRule of the WCF Relays examples: - name: Deletes the AuthorizationRule of the WCF Relays - text: az relay wcfrelay authorizationrule delete --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule + text: az relay wcf-relay authorization-rule delete --resource-group myresourcegroup --namespace-name mynamespace --wcfrelay-name mywcfrelay --name myauthorule """ helps['relay hybrid-connections create'] = """ @@ -257,50 +257,50 @@ text: az relay hybrid-connections delete --resource-group myresourcegroup --namespace-name mynamespace --name myhybridconnection """ -helps['relay hybrid-connections authorizationrule create'] = """ +helps['relay hybrid-connections authorization-rule create'] = """ type: command short-summary: Creates Authorization rule for the given Hybrid Connections examples: - name: Creates Authorization rules - text: az relay hybrid-connections authorizationrule create --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule --access-rights Listen + text: az relay hybrid-connections authorization-rule create --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule --access-rights Listen """ -helps['relay hybrid-connections authorizationrule show'] = """ +helps['relay hybrid-connections authorization-rule show'] = """ type: command short-summary: shows the details of AuthorizationRule examples: - name: shows the details of AuthorizationRule - text: az relay hybrid-connection authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule + text: az relay hybrid-connection authorization-rule show --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule """ -helps['relay hybrid-connection authorizationrule list'] = """ +helps['relay hybrid-connection authorization-rule list'] = """ type: command short-summary: shows the list of AuthorizationRule by Hybrid Connections examples: - name: shows the list of AuthorizationRule by Hybrid Connections - text: az relay hybrid-connections authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection + text: az relay hybrid-connections authorization-rule show --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection """ -helps['relay hybrid-connections authorizationrule keys list'] = """ +helps['relay hybrid-connections authorization-rule keys list'] = """ type: command short-summary: Shows the connection strings of AuthorizationRule for the Hybrid Connections. examples: - name: Shows the connection strings of AuthorizationRule for the Hybrid Connections. - text: az relay hybrid-connections authorizationrule list-keys --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule + text: az relay hybrid-connections authorization-rule list-keys --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule """ -helps['relay hybrid-connections authorizationrule keys renew'] = """ +helps['relay hybrid-connections authorization-rule keys renew'] = """ type: command - short-summary: Regenerate the connectionstrings of AuthorizationRule for the namespace. + short-summary: Regenerate the connection strings of AuthorizationRule for the namespace. examples: - - name: Regenerate the connectionstrings of AuthorizationRule for the namespace. - text: az relay hybrid-connections authorizationrule regenerate-keys --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule --key PrimaryKey + - name: Regenerate the connection strings of AuthorizationRule for the namespace. + text: az relay hybrid-connections authorization-rule regenerate-keys --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule --key PrimaryKey """ -helps['relay hybrid-connections authorizationrule delete'] = """ +helps['relay hybrid-connections authorization-rule delete'] = """ type: command short-summary: Deletes the AuthorizationRule of the Hybrid Connections. examples: - name: Deletes the AuthorizationRule of the Hybrid Connections. - text: az relay hybrid-connections authorizationrule delete --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule + text: az relay hybrid-connections authorization-rule delete --resource-group myresourcegroup --namespace-name mynamespace --hybrid-connection-name myhybridconnection --name myauthorule """ diff --git a/src/relay/azext_relay/_params.py b/src/relay/azext_relay/_params.py index 419c0eb4620..b463fe84d43 100644 --- a/src/relay/azext_relay/_params.py +++ b/src/relay/azext_relay/_params.py @@ -2,84 +2,78 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - -from azure.cli.core.commands.parameters import (tags_type, get_enum_type, resource_group_name_type) # pylint: disable=line-too-long +from azure.cli.core.commands.parameters import (tags_type, get_enum_type, get_location_type, name_type, resource_group_name_type, get_three_state_flag) +from knack.arguments import CLIArgumentType +from azext_relay.relay.models.relay_management_client_enums import AccessRights, KeyType, SkuTier, Relaytype + + +rights_arg_type = CLIArgumentType(options_list=['--access-rights'], nargs='+', type=str, arg_type=get_enum_type(AccessRights), help='Authorization rule rights of type list') +key_arg_type = CLIArgumentType(options_list=['--key-name'], arg_type=get_enum_type(KeyType), help='specifies Primary or Secondary key needs to be reset') + -def load_arguments_namespace(self, _): +def load_arguments_relayparams(self, _): with self.argument_context('relay') as c: c.argument('resource_group_name', arg_type=resource_group_name_type) c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace') - with self.argument_context('relay namespace exists') as c: - c.argument('namespace_name', options_list=['--name', '-n'], help='name of the Namespace') + with self.argument_context('relay namespace') as c: + c.argument('namespace_name', arg_type=name_type, help='name of the Namespace') with self.argument_context('relay namespace create') as c: - c.argument('namespace_name', options_list=['--name', '-n'], help='name of the Namespace') - c.argument('tags', options_list=['--tags', '-t'], arg_type=tags_type, help='tags for the namespace in Key value pair format') - c.argument('location', options_list=['--location', '-l'], help='Location') - c.argument('skutier', options_list=['--sku-tier'], arg_type=get_enum_type(['Basic', 'Standard'])) + c.argument('tags', arg_type=tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx)) + c.argument('skutier', options_list=['--sku-tier'], arg_type=get_enum_type(SkuTier)) c.argument('capacity', options_list=['--capacity'], type=int, help='Capacity for Sku') - # region Namespace Get - for scope in ['relay namespace show', 'relay namespace delete']: + for scope in ['relay namespace authorization-rule', 'relay namespace authorization-rule keys renew', 'relay namespace authorization-rule keys list']: with self.argument_context(scope) as c: - c.argument('namespace_name', options_list=['--name', '-n'], help='name of the Namespace') + c.argument('authorization_rule_name', arg_type=name_type, help='name of the Namespace AuthorizationRule') + c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace') - # region Namespace Authorizationrule - for scope in ['relay namespace authorizationrule', 'relay namespace authorizationrule keys list', 'relay namespace authorizationrule keys renew']: - with self.argument_context(scope) as c: - c.argument('authorization_rule_name', options_list=['--name', '-n'], help='name of the Namespace AuthorizationRule') - - with self.argument_context('relay namespace authorizationrule create') as c: - c.argument('accessrights', options_list=['--access-rights'], arg_type=get_enum_type(['Send', 'Listen', 'Manage']), help='Authorization rule rights of type list') + with self.argument_context('relay namespace authorization-rule create') as c: + c.argument('accessrights', arg_type=rights_arg_type) - with self.argument_context('relay namespace authorizationrule keys renew') as c: - c.argument('key_type', options_list=['--key-name'], arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey']), help='specifies Primary or Secondary key needs to be reset') + with self.argument_context('relay namespace authorization-rule keys renew') as c: + c.argument('key_type', arg_type=key_arg_type) +# region WCF Relay + with self.argument_context('relay wcf-relay') as c: + c.argument('relay_name', arg_type=name_type, help='Name of WCF Relay') -# region - WCF Relay Create -def load_arguments_wcfrelay(self, _): - with self.argument_context('relay wcfrelay') as c: - c.argument('relay_name', options_list=['--name', '-n'], help='Name of WCF Relay') + with self.argument_context('relay wcf-relay create') as c: + c.argument('relay_type', options_list=['--relay-type'], arg_type=get_enum_type(Relaytype), help='WCF relay type.') + c.argument('requires_client_authorization', options_list=['--requires-client-authorization'], arg_type=get_three_state_flag(), help='True if client authorization is needed for this relay; otherwise, false.') + c.argument('requires_transport_security', options_list=['--requires-transport-security'], arg_type=get_three_state_flag(), help='True if transport security is needed for this relay; otherwise, false.') + c.argument('user_metadata', help='The usermetadata is a placeholder to store user-defined string data for the WCF Relay endpoint. For example, it can be used to store descriptive data, such as list of teams and their contact information. Also, user-defined configuration settings can be stored.') - with self.argument_context('relay wcfrelay create') as c: - c.argument('relay_type', options_list=['--relay-type'], arg_type=get_enum_type(['NetTcp', 'Http']), help='WCF relay type.') - c.argument('requires_client_authorization', options_list=['--requires-client-authorization'], type=bool, help='True if client authorization is needed for this relay; otherwise, false.') - c.argument('requires_transport_security', options_list=['--requires-transport-security'], type=bool, help='True if transport security is needed for this relay; otherwise, false.') - c.argument('user_metadata', options_list=['--user-metadata'], help='The usermetadata is a placeholder to store user-defined string data for the WCF Relay endpoint. For example, it can be used to store descriptive data, such as list of teams and their contact information. Also, user-defined configuration settings can be stored.') - - # region WCF Relay Authorizationrule - for scope in ['relay wcfrelay authorizationrule', 'relay wcfrelay authorizationrule keys list', 'relay wcfrelay authorizationrule keys renew']: + for scope in ['relay wcf-relay authorization-rule', 'relay wcf-relay authorization-rule keys list', 'relay wcf-relay authorization-rule keys renew']: with self.argument_context(scope) as c: - c.argument('authorization_rule_name', options_list=['--name', '-n'], help='name of the WCF Relay AuthorizationRule') + c.argument('authorization_rule_name', arg_type=name_type, help='name of the WCF Relay AuthorizationRule') c.argument('relay_name', options_list=['--wcfrelay-name'], help='name of the WCF Relay') - with self.argument_context('relay wcfrelay authorizationrule create') as c: - c.argument('rights', options_list=['--access-rights'], arg_type=get_enum_type(['Send', 'Listen', 'Manage']), help='AuthorizationRule rights of type list') - - with self.argument_context('relay wcfrelay authorizationrule keys renew') as c: - c.argument('key_type', options_list=['--key-name'], arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey'])) + with self.argument_context('relay wcf-relay authorization-rule create') as c: + c.argument('rights', arg_type=rights_arg_type) + with self.argument_context('relay wcf-relay authorization-rule keys renew') as c: + c.argument('key_type', arg_type=key_arg_type) -# region - Hybrid Connection Create -def load_arguments_hybridconnections(self, _): +# region Hybrid Connection with self.argument_context('relay hybrid-connections') as c: - c.argument('hybrid_connection_name', options_list=['--name', '-n'], help='Name of Hybrid Connection') + c.argument('hybrid_connection_name', arg_type=name_type, help='Name of Hybrid Connection') with self.argument_context('relay hybrid-connections create') as c: - c.argument('requires_client_authorization', options_list=['--requires-client-authorization'], type=bool, help='True if client authorization is needed for this relay; otherwise, false.') - c.argument('user_metadata', options_list=['--user-metadata'], help='The usermetadata is a placeholder to store user-defined string data for the Hybrid Connection endpoint. For example, it can be used to store descriptive data, such as list of teams and their contact information. Also, user-defined configuration settings can be stored.') + c.argument('requires_client_authorization', arg_type=get_three_state_flag(), help='True if client authorization is needed for this relay; otherwise, false.') + c.argument('user_metadata', help='The usermetadata is a placeholder to store user-defined string data for the Hybrid Connection endpoint. For example, it can be used to store descriptive data, such as list of teams and their contact information. Also, user-defined configuration settings can be stored.') - # region Hybrid Connection Authorizationrule - for scope in ['relay hybrid-connections authorizationrule', 'relay hybrid-connections authorizationrule keys list', 'relay Hybrid Connection authorizationrule keys renew']: + for scope in ['relay hybrid-connections authorization-rule', 'relay hybrid-connections authorization-rule keys list', 'relay Hybrid Connection authorization-rule keys renew']: with self.argument_context(scope) as c: - c.argument('authorization_rule_name', options_list=['--name', '-n'], help='name of the Hybrid Connection AuthorizationRule') + c.argument('authorization_rule_name', arg_type=name_type, help='name of the Hybrid Connection AuthorizationRule') c.argument('hybrid_connection_name', options_list=['--hybrid-connection-name'], help='name of the Hybrid Connection') - with self.argument_context('relay hybrid-connections authorizationrule create') as c: - c.argument('rights', options_list=['--access-rights'], arg_type=get_enum_type(['Send', 'Listen', 'Manage']), help='AuthorizationRule rights of type list') + with self.argument_context('relay hybrid-connections authorization-rule create') as c: + c.argument('rights', arg_type=rights_arg_type) - with self.argument_context('relay hybrid-connections authorizationrule keys renew') as c: - c.argument('key_type', options_list=['--key-name'], arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey'])) + with self.argument_context('relay hybrid-connections authorization-rule keys renew') as c: + c.argument('key_type', arg_type=key_arg_type) diff --git a/src/relay/azext_relay/commands.py b/src/relay/azext_relay/commands.py index 0b5b941dd8a..3aef862d401 100644 --- a/src/relay/azext_relay/commands.py +++ b/src/relay/azext_relay/commands.py @@ -39,7 +39,7 @@ def load_command_table(self, _): g.command('delete', 'delete') g.command('exists', 'check_name_availability_method') - with self.command_group('relay namespace authorizationrule', relay_namespace_util, client_factory=namespaces_mgmt_client_factory) as g: + with self.command_group('relay namespace authorization-rule', relay_namespace_util, client_factory=namespaces_mgmt_client_factory) as g: g.custom_command('create', 'cli_namespaceautho_create') g.command('show', 'get_authorization_rule', exception_handler=empty_on_404) g.command('list', 'list_authorization_rules', exception_handler=empty_on_404) @@ -48,13 +48,13 @@ def load_command_table(self, _): g.command('delete', 'delete_authorization_rule') # WcfRelay Region - with self.command_group('relay wcfrelay', relay_wcf_relay_util, client_factory=wcfrelay_mgmt_client_factory) as g: + with self.command_group('relay wcf-relay', relay_wcf_relay_util, client_factory=wcfrelay_mgmt_client_factory) as g: g.custom_command('create', 'cli_wcfrelay_create') g.command('show', 'get', exception_handler=empty_on_404) g.command('list', 'list_by_namespace', exception_handler=empty_on_404) g.command('delete', 'delete') - with self.command_group('relay wcfrelay authorizationrule', relay_wcf_relay_util, client_factory=wcfrelay_mgmt_client_factory) as g: + with self.command_group('relay wcf-relay authorization-rule', relay_wcf_relay_util, client_factory=wcfrelay_mgmt_client_factory) as g: g.custom_command('create', 'cli_wcfrelayautho_create') g.command('show', 'get_authorization_rule', exception_handler=empty_on_404) g.command('list', 'list_authorization_rules', exception_handler=empty_on_404) @@ -69,7 +69,7 @@ def load_command_table(self, _): g.command('list', 'list_by_namespace', exception_handler=empty_on_404) g.command('delete', 'delete') - with self.command_group('relay hybrid-connections authorizationrule', relay_hybrid_connections_util, client_factory=hydrid_connections_mgmt_client_factory) as g: + with self.command_group('relay hybrid-connections authorization-rule', relay_hybrid_connections_util, client_factory=hydrid_connections_mgmt_client_factory) as g: g.custom_command('create', 'cli_hybridconnectionsautho_create') g.command('show', 'get_authorization_rule', exception_handler=empty_on_404) g.command('list', 'list_authorization_rules', exception_handler=empty_on_404) diff --git a/src/relay/azext_relay/custom.py b/src/relay/azext_relay/custom.py index faacee90aa0..8cae2f82707 100644 --- a/src/relay/azext_relay/custom.py +++ b/src/relay/azext_relay/custom.py @@ -7,14 +7,15 @@ # pylint: disable=too-many-lines # pylint: disable=inconsistent-return-statements -from azext_relay._utils import accessrights_converter - -from azext_relay.relay.models import (RelayNamespace, Sku, WcfRelay) - # Namespace Region def cli_namespace_create(client, resource_group_name, namespace_name, location, tags=None, skutier=None): - return client.create_or_update(resource_group_name, namespace_name, RelayNamespace(location, tags, Sku(skutier))) + from azext_relay.relay.models import RelayNamespace, Sku + return client.create_or_update( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + parameters=RelayNamespace(location, tags, Sku(skutier)) + ) def cli_namespace_list(client, resource_group_name=None): @@ -27,13 +28,21 @@ def cli_namespace_list(client, resource_group_name=None): # Namespace Authorization rule: -def cli_namespaceautho_create(client, resource_group_name, namespace_name, name, accessrights=None): - return client.create_or_update_authorization_rule(resource_group_name, namespace_name, name, - accessrights_converter(accessrights)) +def cli_namespaceautho_create(client, resource_group_name, namespace_name, name, access_rights=None): + from azext_relay._utils import accessrights_converter + if not access_rights: + access_rights = access_rights.split() + return client.create_or_update_authorization_rule( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + authorization_rule_name=name, + rights=accessrights_converter(access_rights) + ) # WcfRelay Region def cli_wcfrelay_create(client, resource_group_name, namespace_name, name, relay_type=None, requires_client_authorization=None, requires_transport_security=None, user_metadata=None): + from azext_relay.relay.models import WcfRelay wcfrelayparameter1 = WcfRelay() if relay_type: wcfrelayparameter1.relay_type = relay_type @@ -47,17 +56,34 @@ def cli_wcfrelay_create(client, resource_group_name, namespace_name, name, relay if user_metadata: wcfrelayparameter1.user_metadata = user_metadata - return client.create_or_update(resource_group_name, namespace_name, name, wcfrelayparameter1) + return client.create_or_update( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + relay_name=name, + parameters=wcfrelayparameter1 + ) def cli_wcfrelayautho_create(client, resource_group_name, namespace_name, wcfrelay_name, name, access_rights=None): - return client.create_or_update_authorization_rule(resource_group_name, namespace_name, wcfrelay_name, name, - accessrights_converter(access_rights)) + from azext_relay._utils import accessrights_converter + return client.create_or_update_authorization_rule( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + relay_name=wcfrelay_name, + authorization_rule_name=name, + rights=accessrights_converter(access_rights) + ) def cli_hybridconnectionsautho_create(client, resource_group_name, namespace_name, hybrid_connection_name, name, access_rights=None): - return client.create_or_update_authorization_rule(resource_group_name, namespace_name, hybrid_connection_name, name, - accessrights_converter(access_rights)) + from azext_relay._utils import accessrights_converter + return client.create_or_update_authorization_rule( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + hybrid_connection_name=hybrid_connection_name, + authorization_rule_name=name, + rights=accessrights_converter(access_rights) + ) # pylint: disable=inconsistent-return-statements diff --git a/src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml b/src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml index b2db5c31e0c..c8f61873804 100644 --- a/src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml +++ b/src/relay/azext_relay/tests/recordings/test_relay_hybridconnection.yaml @@ -10,7 +10,7 @@ interactions: Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.26] + AZURECLI/2.0.27] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_relay_hybridconnection000001?api-version=2017-05-10 @@ -20,14 +20,14 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:18:20 GMT'] + date: ['Fri, 09 Feb 2018 23:05:18 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 201, message: Created} - request: - body: '{"location": "westus2", "tags": {"{tag1: value1,": "", "tag2: value2}": + body: '{"location": "westus2", "tags": {"{tag2: value2,": "", "tag1: value1}": ""}, "sku": {"name": "Standard", "tier": "Standard"}}' headers: Accept: [application/json] @@ -37,18 +37,18 @@ interactions: Content-Length: ['125'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:18:20.113Z","updatedAt":"2018-02-06T18:18:20.113Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-09T23:05:19.93Z","updatedAt":"2018-02-09T23:05:19.93Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} headers: cache-control: [no-cache] - content-length: ['686'] + content-length: ['684'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:18:21 GMT'] + date: ['Fri, 09 Feb 2018 23:05:19 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -67,18 +67,18 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:18:20.113Z","updatedAt":"2018-02-06T18:18:44.957Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-09T23:05:19.93Z","updatedAt":"2018-02-09T23:05:45.093Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] - content-length: ['684'] + content-length: ['683'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:18:52 GMT'] + date: ['Fri, 09 Feb 2018 23:05:55 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -96,18 +96,18 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:18:20.113Z","updatedAt":"2018-02-06T18:18:44.957Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-09T23:05:19.93Z","updatedAt":"2018-02-09T23:05:45.093Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] - content-length: ['684'] + content-length: ['683'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:18:53 GMT'] + date: ['Fri, 09 Feb 2018 23:06:34 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -126,18 +126,18 @@ interactions: Content-Length: ['85'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004","name":"relay-hybridcli000004","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West - US 2","properties":{"createdAt":"2018-02-06T18:18:57.6743415Z","updatedAt":"2018-02-06T18:18:57.6743415Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}'} + US 2","properties":{"createdAt":"2018-02-09T23:06:09.1458152Z","updatedAt":"2018-02-09T23:06:09.1458152Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}'} headers: cache-control: [no-cache] content-length: ['549'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:18:57 GMT'] + date: ['Fri, 09 Feb 2018 23:06:09 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -156,18 +156,18 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004","name":"relay-hybridcli000004","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West - US 2","properties":{"createdAt":"2018-02-06T18:18:57.6743415Z","updatedAt":"2018-02-06T18:18:57.6743415Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}'} + US 2","properties":{"createdAt":"2018-02-09T23:06:09.1458152Z","updatedAt":"2018-02-09T23:06:09.1458152Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}'} headers: cache-control: [no-cache] content-length: ['549'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:18:58 GMT'] + date: ['Fri, 09 Feb 2018 23:06:14 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -185,18 +185,18 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections?api-version=2017-04-01 response: body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004","name":"relay-hybridcli000004","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West - US 2","properties":{"createdAt":"2018-02-06T18:18:57.6743415Z","updatedAt":"2018-02-06T18:18:57.6743415Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}]}'} + US 2","properties":{"createdAt":"2018-02-09T23:06:09.1458152Z","updatedAt":"2018-02-09T23:06:09.1458152Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"UserMetadata"}}]}'} headers: cache-control: [no-cache] content-length: ['561'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:18:59 GMT'] + date: ['Fri, 09 Feb 2018 23:06:16 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -207,27 +207,27 @@ interactions: x-ms-inline-count: [''] status: {code: 200, message: OK} - request: - body: '{"properties": {"rights": ["Listen"]}}' + body: '{"properties": {"rights": ["Send"]}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay hybrid-connections authorizationrule create] + CommandName: [relay hybrid-connections authorization-rule create] Connection: [keep-alive] - Content-Length: ['38'] + Content-Length: ['36'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005","name":"clihybridAutho000005","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West - US 2","properties":{"rights":["Listen"]}}'} + US 2","properties":{"rights":["Send"]}}'} headers: cache-control: [no-cache] - content-length: ['464'] + content-length: ['462'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:19:00 GMT'] + date: ['Fri, 09 Feb 2018 23:06:16 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -235,29 +235,29 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay hybrid-connections authorizationrule show] + CommandName: [relay hybrid-connections authorization-rule show] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005","name":"clihybridAutho000005","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West - US 2","properties":{"rights":["Listen"]}}'} + US 2","properties":{"rights":["Send"]}}'} headers: cache-control: [no-cache] - content-length: ['464'] + content-length: ['462'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:19:01 GMT'] + date: ['Fri, 09 Feb 2018 23:06:16 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -271,22 +271,22 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay hybrid-connections authorizationrule keys list] + CommandName: [relay hybrid-connections authorization-rule keys list] Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005/listKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=LA3u6Y0BeLNOI+Yw/tQX22/Yt+4LaaytCnTL30iZoC0=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=HJf40Bd9aJo979nczVdsNghQeUbLV8LARpFIlbND6CE=;EntityPath=relay-hybridcli000004","primaryKey":"LA3u6Y0BeLNOI+Yw/tQX22/Yt+4LaaytCnTL30iZoC0=","secondaryKey":"HJf40Bd9aJo979nczVdsNghQeUbLV8LARpFIlbND6CE=","keyName":"clihybridAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=8bwsG2YMQ7aS4zOm1tfttggJk6dpCocxmMX4Z6kF3do=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=O0O1A/4uUAT+v8Ue4bGnGVZBNq+BhPEjKUPZcBZt0RA=;EntityPath=relay-hybridcli000004","primaryKey":"8bwsG2YMQ7aS4zOm1tfttggJk6dpCocxmMX4Z6kF3do=","secondaryKey":"O0O1A/4uUAT+v8Ue4bGnGVZBNq+BhPEjKUPZcBZt0RA=","keyName":"clihybridAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:19:01 GMT'] + date: ['Fri, 09 Feb 2018 23:06:17 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -294,29 +294,29 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} - request: body: '{"keyType": "PrimaryKey"}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay hybrid-connections authorizationrule keys renew] + CommandName: [relay hybrid-connections authorization-rule keys renew] Connection: [keep-alive] Content-Length: ['25'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=aqyRY6SB3lh5wI0KX1kAieTC87cseUyA1qnfGAvt5uw=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=HJf40Bd9aJo979nczVdsNghQeUbLV8LARpFIlbND6CE=;EntityPath=relay-hybridcli000004","primaryKey":"aqyRY6SB3lh5wI0KX1kAieTC87cseUyA1qnfGAvt5uw=","secondaryKey":"HJf40Bd9aJo979nczVdsNghQeUbLV8LARpFIlbND6CE=","keyName":"clihybridAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=LfNCFfmrEaFHA+3taYS6W0DVNHK92lPdTqRUsdv7lJA=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=O0O1A/4uUAT+v8Ue4bGnGVZBNq+BhPEjKUPZcBZt0RA=;EntityPath=relay-hybridcli000004","primaryKey":"LfNCFfmrEaFHA+3taYS6W0DVNHK92lPdTqRUsdv7lJA=","secondaryKey":"O0O1A/4uUAT+v8Ue4bGnGVZBNq+BhPEjKUPZcBZt0RA=","keyName":"clihybridAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:19:02 GMT'] + date: ['Fri, 09 Feb 2018 23:06:18 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -331,22 +331,22 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay hybrid-connections authorizationrule keys renew] + CommandName: [relay hybrid-connections authorization-rule keys renew] Connection: [keep-alive] Content-Length: ['27'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=aqyRY6SB3lh5wI0KX1kAieTC87cseUyA1qnfGAvt5uw=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=to118zbkBieq+AfOK+gciOROEAG0Lu/nH52/sLiu9Jc=;EntityPath=relay-hybridcli000004","primaryKey":"aqyRY6SB3lh5wI0KX1kAieTC87cseUyA1qnfGAvt5uw=","secondaryKey":"to118zbkBieq+AfOK+gciOROEAG0Lu/nH52/sLiu9Jc=","keyName":"clihybridAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=LfNCFfmrEaFHA+3taYS6W0DVNHK92lPdTqRUsdv7lJA=;EntityPath=relay-hybridcli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=clihybridAutho000005;SharedAccessKey=WI390eCdmNhBjWKnBtXQg2Z/AYyTczS4aAgKFHAWgzQ=;EntityPath=relay-hybridcli000004","primaryKey":"LfNCFfmrEaFHA+3taYS6W0DVNHK92lPdTqRUsdv7lJA=","secondaryKey":"WI390eCdmNhBjWKnBtXQg2Z/AYyTczS4aAgKFHAWgzQ=","keyName":"clihybridAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:19:03 GMT'] + date: ['Fri, 09 Feb 2018 23:06:19 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -354,19 +354,19 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay hybrid-connections authorizationrule delete] + CommandName: [relay hybrid-connections authorization-rule delete] Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004/authorizationRules/clihybridAutho000005?api-version=2017-04-01 @@ -375,7 +375,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:19:04 GMT'] + date: ['Fri, 09 Feb 2018 23:06:18 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -393,7 +393,7 @@ interactions: Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/hybridConnections/relay-hybridcli000004?api-version=2017-04-01 @@ -402,7 +402,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:19:06 GMT'] + date: ['Fri, 09 Feb 2018 23:06:23 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -420,7 +420,7 @@ interactions: Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 @@ -429,14 +429,14 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:19:07 GMT'] + date: ['Fri, 09 Feb 2018 23:06:25 GMT'] expires: ['-1'] location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] server-sb: [Service-Bus-Resource-Provider/SN1] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1195'] status: {code: 202, message: Accepted} - request: body: null @@ -447,7 +447,7 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_hybridconnection000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01 @@ -456,7 +456,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:19:37 GMT'] + date: ['Fri, 09 Feb 2018 23:06:56 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -474,7 +474,7 @@ interactions: Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.26] + AZURECLI/2.0.27] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_relay_hybridconnection000001?api-version=2017-05-10 @@ -483,11 +483,11 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:19:39 GMT'] + date: ['Fri, 09 Feb 2018 23:06:57 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkVMQVk6NUZIWUJSSURDT05ORUNUSU9OQlZDMjNWNEFXRHxGRjlDMkE2RTY4MTVEMTQ0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkVMQVk6NUZIWUJSSURDT05ORUNUSU9OVkxYUlBVUTJaT3xEM0IyNTA4MkJGMURFOTg5LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml b/src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml index 37cde91b2b7..11c9b588a9a 100644 --- a/src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml +++ b/src/relay/azext_relay/tests/recordings/test_relay_namespace.yaml @@ -10,7 +10,7 @@ interactions: Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.26] + AZURECLI/2.0.27] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_eh_namespace000001?api-version=2017-05-10 @@ -20,7 +20,7 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:19:40 GMT'] + date: ['Fri, 09 Feb 2018 23:06:57 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -36,7 +36,7 @@ interactions: Content-Length: ['32'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Relay/checkNameAvailability?api-version=2017-04-01 @@ -46,7 +46,7 @@ interactions: cache-control: [no-cache] content-length: ['53'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:19:40 GMT'] + date: ['Fri, 09 Feb 2018 23:06:59 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -67,18 +67,18 @@ interactions: Content-Length: ['104'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:19:40.797Z","updatedAt":"2018-02-06T18:19:40.797Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-09T23:07:00.92Z","updatedAt":"2018-02-09T23:07:00.92Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} headers: cache-control: [no-cache] - content-length: ['667'] + content-length: ['665'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:19:42 GMT'] + date: ['Fri, 09 Feb 2018 23:07:01 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -97,18 +97,18 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:19:40.797Z","updatedAt":"2018-02-06T18:20:06.373Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-09T23:07:00.92Z","updatedAt":"2018-02-09T23:07:22.3Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] - content-length: ['665'] + content-length: ['662'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:20:12 GMT'] + date: ['Fri, 09 Feb 2018 23:07:32 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -126,18 +126,18 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:19:40.797Z","updatedAt":"2018-02-06T18:20:06.373Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-09T23:07:00.92Z","updatedAt":"2018-02-09T23:07:22.3Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] - content-length: ['665'] + content-length: ['662'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:20:13 GMT'] + date: ['Fri, 09 Feb 2018 23:07:33 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -155,7 +155,7 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Relay/namespaces?api-version=2017-04-01 @@ -163,15 +163,15 @@ interactions: body: {string: '{"value":[{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_alias2mv7ov6fsgikow24xobpownip4z7mijgbqjghkrz5zav4njw5lcf6lf7px/providers/Microsoft.Relay/namespaces/TestingRelay99","name":"TestingRelay99","type":"Microsoft.Relay/Namespaces","location":"West US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingrelay99","createdAt":"2018-02-05T22:40:33.257Z","updatedAt":"2018-02-05T22:41:00.467Z","serviceBusEndpoint":"https://TestingRelay99.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SDKTests/providers/Microsoft.Relay/namespaces/TestingIgniteNamespaceRelay","name":"TestingIgniteNamespaceRelay","type":"Microsoft.Relay/Namespaces","location":"West US 2","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingignitenamespacerelay","createdAt":"2017-09-22T23:10:13.723Z","updatedAt":"2017-09-22T23:11:10.827Z","serviceBusEndpoint":"https://TestingIgniteNamespaceRelay.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:19:40.797Z","updatedAt":"2018-02-06T18:20:06.373Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RGName-onesdk9880/providers/Microsoft.Relay/namespaces/testingnamespaceforwcfRelay","name":"testingnamespaceforwcfRelay","type":"Microsoft.Relay/Namespaces","location":"West + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-09T23:07:00.92Z","updatedAt":"2018-02-09T23:07:22.3Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RGName-onesdk9880/providers/Microsoft.Relay/namespaces/testingnamespaceforwcfRelay","name":"testingnamespaceforwcfRelay","type":"Microsoft.Relay/Namespaces","location":"West US 2","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingnamespaceforwcfrelay","createdAt":"2017-11-10T18:07:19.713Z","updatedAt":"2017-11-10T18:07:45.843Z","serviceBusEndpoint":"https://testingnamespaceforwcfRelay.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.Relay/namespaces/RelayTest1234","name":"RelayTest1234","type":"Microsoft.Relay/Namespaces","location":"West US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relaytest1234","createdAt":"2017-04-26T00:38:15.667Z","updatedAt":"2017-08-25T02:09:28.613Z","serviceBusEndpoint":"https://RelayTest1234.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_alias2mv7ov6fsgikow24xobpownip4z7mijgbqjghkrz5zav4njw5lcf6lf7px/providers/Microsoft.Relay/namespaces/testingrelay1","name":"testingrelay1","type":"Microsoft.Relay/Namespaces","location":"West US","tags":{"tage":"value1"},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingrelay1","createdAt":"2018-02-05T18:09:29.373Z","updatedAt":"2018-02-05T18:09:57.353Z","serviceBusEndpoint":"https://testingrelay1.servicebus.windows.net:443/","status":"Active"}}]}'} headers: cache-control: [no-cache] - content-length: ['3719'] + content-length: ['3716'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:20:14 GMT'] + date: ['Fri, 09 Feb 2018 23:07:33 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -189,18 +189,18 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces?api-version=2017-04-01 response: body: {string: '{"value":[{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:19:40.797Z","updatedAt":"2018-02-06T18:20:06.373Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}]}'} + US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-09T23:07:00.92Z","updatedAt":"2018-02-09T23:07:22.3Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}]}'} headers: cache-control: [no-cache] - content-length: ['677'] + content-length: ['674'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:20:14 GMT'] + date: ['Fri, 09 Feb 2018 23:07:33 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -214,12 +214,12 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay namespace authorizationrule create] + CommandName: [relay namespace authorization-rule create] Connection: [keep-alive] Content-Length: ['36'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003?api-version=2017-04-01 @@ -230,7 +230,7 @@ interactions: cache-control: [no-cache] content-length: ['390'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:20:47 GMT'] + date: ['Fri, 09 Feb 2018 23:08:06 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -238,18 +238,18 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay namespace authorizationrule show] + CommandName: [relay namespace authorization-rule show] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003?api-version=2017-04-01 @@ -260,7 +260,7 @@ interactions: cache-control: [no-cache] content-length: ['390'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:20:47 GMT'] + date: ['Fri, 09 Feb 2018 23:08:08 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -274,11 +274,11 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay namespace authorizationrule show] + CommandName: [relay namespace authorization-rule show] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/RootManageSharedAccessKey?api-version=2017-04-01 @@ -289,7 +289,7 @@ interactions: cache-control: [no-cache] content-length: ['418'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:20:48 GMT'] + date: ['Fri, 09 Feb 2018 23:08:09 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -303,22 +303,22 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay namespace authorizationrule keys list] + CommandName: [relay namespace authorization-rule keys list] Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003/listKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=uY1GRjQzgeSyeJ3ObXTBjS5WWabAdpG559fTOKbw6ws=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=syAEy71/oWqvNlwadtk7LvQmB762YxlGG6OSYlQmpQs=","primaryKey":"uY1GRjQzgeSyeJ3ObXTBjS5WWabAdpG559fTOKbw6ws=","secondaryKey":"syAEy71/oWqvNlwadtk7LvQmB762YxlGG6OSYlQmpQs=","keyName":"cliAutho000003"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=4tWtA0d/XwXKmPFrrWMzSuAH/VSTYI4u843zQEJNaR8=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=HWBd33USWCa5Ccg0lftrK5AfYVlbl/UYtUl+H5nwEZg=","primaryKey":"4tWtA0d/XwXKmPFrrWMzSuAH/VSTYI4u843zQEJNaR8=","secondaryKey":"HWBd33USWCa5Ccg0lftrK5AfYVlbl/UYtUl+H5nwEZg=","keyName":"cliAutho000003"}'} headers: cache-control: [no-cache] content-length: ['536'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:20:49 GMT'] + date: ['Fri, 09 Feb 2018 23:08:10 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -333,22 +333,22 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay namespace authorizationrule keys renew] + CommandName: [relay namespace authorization-rule keys renew] Connection: [keep-alive] Content-Length: ['25'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=I7Ebez8OhXv6wu9duRKaiU0hN7TBkZeQw/Ry0MXeij0=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=syAEy71/oWqvNlwadtk7LvQmB762YxlGG6OSYlQmpQs=","primaryKey":"I7Ebez8OhXv6wu9duRKaiU0hN7TBkZeQw/Ry0MXeij0=","secondaryKey":"syAEy71/oWqvNlwadtk7LvQmB762YxlGG6OSYlQmpQs=","keyName":"cliAutho000003"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=4ALvnsCLkCZ03GUg/lDyyO+NrPTVUglfOQaKHOM6WCk=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=HWBd33USWCa5Ccg0lftrK5AfYVlbl/UYtUl+H5nwEZg=","primaryKey":"4ALvnsCLkCZ03GUg/lDyyO+NrPTVUglfOQaKHOM6WCk=","secondaryKey":"HWBd33USWCa5Ccg0lftrK5AfYVlbl/UYtUl+H5nwEZg=","keyName":"cliAutho000003"}'} headers: cache-control: [no-cache] content-length: ['536'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:21:06 GMT'] + date: ['Fri, 09 Feb 2018 23:08:27 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -356,29 +356,29 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} - request: body: '{"keyType": "SecondaryKey"}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay namespace authorizationrule keys renew] + CommandName: [relay namespace authorization-rule keys renew] Connection: [keep-alive] Content-Length: ['27'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=I7Ebez8OhXv6wu9duRKaiU0hN7TBkZeQw/Ry0MXeij0=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=B9qIrDVBLrxmgBVARe50GH6Op5dafl6BgEKOEumhur0=","primaryKey":"I7Ebez8OhXv6wu9duRKaiU0hN7TBkZeQw/Ry0MXeij0=","secondaryKey":"B9qIrDVBLrxmgBVARe50GH6Op5dafl6BgEKOEumhur0=","keyName":"cliAutho000003"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=4ALvnsCLkCZ03GUg/lDyyO+NrPTVUglfOQaKHOM6WCk=","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=60mSnpTdhu+a/J7oR0WU8IYgZ7v+tG0e0CQu40tfsIY=","primaryKey":"4ALvnsCLkCZ03GUg/lDyyO+NrPTVUglfOQaKHOM6WCk=","secondaryKey":"60mSnpTdhu+a/J7oR0WU8IYgZ7v+tG0e0CQu40tfsIY=","keyName":"cliAutho000003"}'} headers: cache-control: [no-cache] content-length: ['536'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:21:23 GMT'] + date: ['Fri, 09 Feb 2018 23:08:43 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -393,12 +393,12 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay namespace authorizationrule delete] + CommandName: [relay namespace authorization-rule delete] Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/authorizationRules/cliAutho000003?api-version=2017-04-01 @@ -407,13 +407,13 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:21:39 GMT'] + date: ['Fri, 09 Feb 2018 23:08:59 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] server-sb: [Service-Bus-Resource-Provider/SN1] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] status: {code: 200, message: OK} - request: body: null @@ -425,7 +425,7 @@ interactions: Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 @@ -434,7 +434,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:21:41 GMT'] + date: ['Fri, 09 Feb 2018 23:09:00 GMT'] expires: ['-1'] location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01'] pragma: [no-cache] @@ -452,7 +452,7 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_eh_namespace000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01 @@ -461,7 +461,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:22:11 GMT'] + date: ['Fri, 09 Feb 2018 23:09:30 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -479,7 +479,7 @@ interactions: Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.26] + AZURECLI/2.0.27] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_eh_namespace000001?api-version=2017-05-10 @@ -488,11 +488,11 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:22:13 GMT'] + date: ['Fri, 09 Feb 2018 23:09:32 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGRUg6NUZOQU1FU1BBQ0VPVk1ZVk1BNVgyREY1M0NCWVZUNnxENjJFREE5ODA4N0FGMjA5LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGRUg6NUZOQU1FU1BBQ0U1U1pYVUpTN1NWSEhSSk9ZQVkzVXxFOTY0Q0Y1NjEyM0Y2Q0U4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml b/src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml index 7ec6c439714..0cffbfb98a6 100644 --- a/src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml +++ b/src/relay/azext_relay/tests/recordings/test_relay_wcfrelay.yaml @@ -10,7 +10,7 @@ interactions: Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.26] + AZURECLI/2.0.27] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_relay_wcfrelay000001?api-version=2017-05-10 @@ -20,14 +20,14 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:14 GMT'] + date: ['Fri, 09 Feb 2018 23:09:33 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 201, message: Created} - request: - body: '{"location": "westus2", "tags": {"{tag1: value1,": "", "tag2: value2}": + body: '{"location": "westus2", "tags": {"{tag2: value2,": "", "tag1: value1}": ""}, "sku": {"name": "Standard", "tier": "Standard"}}' headers: Accept: [application/json] @@ -37,18 +37,18 @@ interactions: Content-Length: ['125'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:22:14.49Z","updatedAt":"2018-02-06T18:22:14.49Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-09T23:09:35.173Z","updatedAt":"2018-02-09T23:09:35.173Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'} headers: cache-control: [no-cache] - content-length: ['684'] + content-length: ['686'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:16 GMT'] + date: ['Fri, 09 Feb 2018 23:09:34 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -67,18 +67,18 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:22:14.49Z","updatedAt":"2018-02-06T18:22:37.4Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-09T23:09:35.173Z","updatedAt":"2018-02-09T23:10:00.07Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] - content-length: ['681'] + content-length: ['683'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:47 GMT'] + date: ['Fri, 09 Feb 2018 23:10:05 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -96,18 +96,18 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 response: body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002","name":"relay-nscli000002","type":"Microsoft.Relay/Namespaces","location":"West - US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-06T18:22:14.49Z","updatedAt":"2018-02-06T18:22:37.4Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} + US 2","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:relay-nscli000002","createdAt":"2018-02-09T23:09:35.173Z","updatedAt":"2018-02-09T23:10:00.07Z","serviceBusEndpoint":"https://relay-nscli000002.servicebus.windows.net:443/","status":"Active"}}'} headers: cache-control: [no-cache] - content-length: ['681'] + content-length: ['683'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:47 GMT'] + date: ['Fri, 09 Feb 2018 23:10:05 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -122,23 +122,23 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay wcfrelay create] + CommandName: [relay wcf-relay create] Connection: [keep-alive] Content-Length: ['143'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004","name":"relay-wcfrelaycli000004","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West - US 2","properties":{"createdAt":"2018-02-06T18:22:50.1225314Z","updatedAt":"2018-02-06T18:22:50.1225314Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}'} + US 2","properties":{"createdAt":"2018-02-09T23:10:08.9954294Z","updatedAt":"2018-02-09T23:10:08.9954294Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}'} headers: cache-control: [no-cache] content-length: ['605'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:49 GMT'] + date: ['Fri, 09 Feb 2018 23:10:08 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -146,29 +146,29 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay wcfrelay show] + CommandName: [relay wcf-relay show] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004","name":"relay-wcfrelaycli000004","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West - US 2","properties":{"createdAt":"2018-02-06T18:22:50.1225314Z","updatedAt":"2018-02-06T18:22:50.1225314Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}'} + US 2","properties":{"createdAt":"2018-02-09T23:10:08.9954294Z","updatedAt":"2018-02-09T23:10:08.9954294Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}'} headers: cache-control: [no-cache] content-length: ['605'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:51 GMT'] + date: ['Fri, 09 Feb 2018 23:10:09 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -182,22 +182,22 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay wcfrelay list] + CommandName: [relay wcf-relay list] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays?api-version=2017-04-01 response: body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004","name":"relay-wcfrelaycli000004","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West - US 2","properties":{"createdAt":"2018-02-06T18:22:50.1225314Z","updatedAt":"2018-02-06T18:22:50.1225314Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}]}'} + US 2","properties":{"createdAt":"2018-02-09T23:10:08.9954294Z","updatedAt":"2018-02-09T23:10:08.9954294Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"UserMetadata"}}]}'} headers: cache-control: [no-cache] content-length: ['617'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:51 GMT'] + date: ['Fri, 09 Feb 2018 23:10:11 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -208,27 +208,27 @@ interactions: x-ms-inline-count: [''] status: {code: 200, message: OK} - request: - body: '{"properties": {"rights": ["Listen"]}}' + body: '{"properties": {"rights": ["Send"]}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay wcfrelay authorizationrule create] + CommandName: [relay wcf-relay authorization-rule create] Connection: [keep-alive] - Content-Length: ['38'] + Content-Length: ['36'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005","name":"cliwcfrelayAutho000005","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West - US 2","properties":{"rights":["Listen"]}}'} + US 2","properties":{"rights":["Send"]}}'} headers: cache-control: [no-cache] - content-length: ['448'] + content-length: ['446'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:52 GMT'] + date: ['Fri, 09 Feb 2018 23:10:43 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -243,22 +243,22 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay wcfrelay authorizationrule show] + CommandName: [relay wcf-relay authorization-rule show] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005?api-version=2017-04-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005","name":"cliwcfrelayAutho000005","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West - US 2","properties":{"rights":["Listen"]}}'} + US 2","properties":{"rights":["Send"]}}'} headers: cache-control: [no-cache] - content-length: ['448'] + content-length: ['446'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:52 GMT'] + date: ['Fri, 09 Feb 2018 23:10:13 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -272,22 +272,22 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay wcfrelay authorizationrule keys list] + CommandName: [relay wcf-relay authorization-rule keys list] Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005/listKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=7ExCuPAj5dpt7kRr7NXkNAyUPrHieP3LyL3V8pK8S9c=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=vV7G1Vo/6jNMenbjrSxFKH87nj6Reyw8rRJGGa7ac9o=;EntityPath=relay-wcfrelaycli000004","primaryKey":"7ExCuPAj5dpt7kRr7NXkNAyUPrHieP3LyL3V8pK8S9c=","secondaryKey":"vV7G1Vo/6jNMenbjrSxFKH87nj6Reyw8rRJGGa7ac9o=","keyName":"cliwcfrelayAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=ktDmJIbKDDj9iTdrrZn6ShoduH8Yw5kzDlqzL68Rcsg=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=K8oPPee/xALfUQzflFnrcxf5xA/YNqrR4Oys8BD6XW8=;EntityPath=relay-wcfrelaycli000004","primaryKey":"ktDmJIbKDDj9iTdrrZn6ShoduH8Yw5kzDlqzL68Rcsg=","secondaryKey":"K8oPPee/xALfUQzflFnrcxf5xA/YNqrR4Oys8BD6XW8=","keyName":"cliwcfrelayAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:53 GMT'] + date: ['Fri, 09 Feb 2018 23:10:13 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -295,29 +295,29 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} - request: body: '{"keyType": "PrimaryKey"}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay wcfrelay authorizationrule keys renew] + CommandName: [relay wcf-relay authorization-rule keys renew] Connection: [keep-alive] Content-Length: ['25'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=IV5obExxGF7vhTujIikP51cAny630n/J/sMySuFKpU4=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=vV7G1Vo/6jNMenbjrSxFKH87nj6Reyw8rRJGGa7ac9o=;EntityPath=relay-wcfrelaycli000004","primaryKey":"IV5obExxGF7vhTujIikP51cAny630n/J/sMySuFKpU4=","secondaryKey":"vV7G1Vo/6jNMenbjrSxFKH87nj6Reyw8rRJGGa7ac9o=","keyName":"cliwcfrelayAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=QergKndRJM/azhWHVBsKcjgLW5dOd9+HLfpnMj7ehHg=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=K8oPPee/xALfUQzflFnrcxf5xA/YNqrR4Oys8BD6XW8=;EntityPath=relay-wcfrelaycli000004","primaryKey":"QergKndRJM/azhWHVBsKcjgLW5dOd9+HLfpnMj7ehHg=","secondaryKey":"K8oPPee/xALfUQzflFnrcxf5xA/YNqrR4Oys8BD6XW8=","keyName":"cliwcfrelayAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:54 GMT'] + date: ['Fri, 09 Feb 2018 23:10:14 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -325,29 +325,29 @@ interactions: strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: body: '{"keyType": "SecondaryKey"}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay wcfrelay authorizationrule keys renew] + CommandName: [relay wcf-relay authorization-rule keys renew] Connection: [keep-alive] Content-Length: ['27'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=IV5obExxGF7vhTujIikP51cAny630n/J/sMySuFKpU4=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=/UYVY/nQsRtU0rYLax+oSwupymKcDYALmIj8KynwtMQ=;EntityPath=relay-wcfrelaycli000004","primaryKey":"IV5obExxGF7vhTujIikP51cAny630n/J/sMySuFKpU4=","secondaryKey":"/UYVY/nQsRtU0rYLax+oSwupymKcDYALmIj8KynwtMQ=","keyName":"cliwcfrelayAutho000005"}'} + body: {string: '{"primaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=QergKndRJM/azhWHVBsKcjgLW5dOd9+HLfpnMj7ehHg=;EntityPath=relay-wcfrelaycli000004","secondaryConnectionString":"Endpoint=sb://relay-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliwcfrelayAutho000005;SharedAccessKey=5Lf5gv6RcITA53D1XOAgz4Y9/etJ8J5csD1UHDE7Ba0=;EntityPath=relay-wcfrelaycli000004","primaryKey":"QergKndRJM/azhWHVBsKcjgLW5dOd9+HLfpnMj7ehHg=","secondaryKey":"5Lf5gv6RcITA53D1XOAgz4Y9/etJ8J5csD1UHDE7Ba0=","keyName":"cliwcfrelayAutho000005"}'} headers: cache-control: [no-cache] content-length: ['625'] content-type: [application/json; charset=utf-8] - date: ['Tue, 06 Feb 2018 18:22:55 GMT'] + date: ['Fri, 09 Feb 2018 23:10:15 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -362,12 +362,12 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay wcfrelay authorizationrule delete] + CommandName: [relay wcf-relay authorization-rule delete] Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004/authorizationRules/cliwcfrelayAutho000005?api-version=2017-04-01 @@ -376,7 +376,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:22:56 GMT'] + date: ['Fri, 09 Feb 2018 23:10:16 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -389,12 +389,12 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [relay wcfrelay delete] + CommandName: [relay wcf-relay delete] Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/wcfRelays/relay-wcfrelaycli000004?api-version=2017-04-01 @@ -403,7 +403,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:22:57 GMT'] + date: ['Fri, 09 Feb 2018 23:10:17 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -421,7 +421,7 @@ interactions: Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002?api-version=2017-04-01 @@ -430,7 +430,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:22:59 GMT'] + date: ['Fri, 09 Feb 2018 23:10:18 GMT'] expires: ['-1'] location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01'] pragma: [no-cache] @@ -448,7 +448,7 @@ interactions: Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 - msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.26] + msrest_azure/0.4.19 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.27] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_relay_wcfrelay000001/providers/Microsoft.Relay/namespaces/relay-nscli000002/operationresults/relay-nscli000002?api-version=2017-04-01 @@ -457,7 +457,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:23:29 GMT'] + date: ['Fri, 09 Feb 2018 23:10:49 GMT'] expires: ['-1'] pragma: [no-cache] server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] @@ -475,7 +475,7 @@ interactions: Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.26] + AZURECLI/2.0.27] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_relay_wcfrelay000001?api-version=2017-05-10 @@ -484,9 +484,9 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Tue, 06 Feb 2018 18:23:31 GMT'] + date: ['Fri, 09 Feb 2018 23:10:51 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkVMQVk6NUZXQ0ZSRUxBWUxSVkRJSUhURzM0QldMV0c3VHwyRTA3NzFFRjhDNkVFOEMwLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkVMQVk6NUZXQ0ZSRUxBWTRHTkFGWUsyNUVCTUczV1VWRnw3OTFCN0Y1RDMwMkZBRjFGLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-ms-ratelimit-remaining-subscription-writes: ['1199'] diff --git a/src/relay/azext_relay/tests/test_relay_commands.py b/src/relay/azext_relay/tests/test_relay_commands.py index 4a73d983691..350a7bfdc00 100644 --- a/src/relay/azext_relay/tests/test_relay_commands.py +++ b/src/relay/azext_relay/tests/test_relay_commands.py @@ -53,36 +53,36 @@ def test_relay_namespace(self, resource_group): # Create Authoriazation Rule self.cmd( - 'relay namespace authorizationrule create --resource-group {rg} --namespace-name {namespacename} --name {authoname} --access-rights {accessrights}', + 'relay namespace authorization-rule create --resource-group {rg} --namespace-name {namespacename} --name {authoname} --access-rights {accessrights}', checks=[self.check('name', self.kwargs['authoname'])]) # Get Authorization Rule self.cmd( - 'relay namespace authorizationrule show --resource-group {rg} --namespace-name {namespacename} --name {authoname}', + 'relay namespace authorization-rule show --resource-group {rg} --namespace-name {namespacename} --name {authoname}', checks=[self.check('name', self.kwargs['authoname'])]) # Get Default Authorization Rule self.cmd( - 'relay namespace authorizationrule show --resource-group {rg} --namespace-name {namespacename} --name {defaultauthorizationrule}', + 'relay namespace authorization-rule show --resource-group {rg} --namespace-name {namespacename} --name {defaultauthorizationrule}', checks=[self.check('name', self.kwargs['defaultauthorizationrule'])]) # Get Authorization Rule Listkeys self.cmd( - 'relay namespace authorizationrule keys list --resource-group {rg} --namespace-name {namespacename} --name {authoname}') + 'relay namespace authorization-rule keys list --resource-group {rg} --namespace-name {namespacename} --name {authoname}') # Regeneratekeys - Primary self.cmd( - 'relay namespace authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --name {authoname} --key-name {primary}') + 'relay namespace authorization-rule keys renew --resource-group {rg} --namespace-name {namespacename} --name {authoname} --key-name {primary}') # Regeneratekeys - Secondary self.cmd( - 'relay namespace authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --name {authoname} --key-name {secondary}') + 'relay namespace authorization-rule keys renew --resource-group {rg} --namespace-name {namespacename} --name {authoname} --key-name {secondary}') # Delete AuthorizationRule self.cmd( - 'relay namespace authorizationrule delete --resource-group {rg} --namespace-name {namespacename} --name {authoname}') + 'relay namespace authorization-rule delete --resource-group {rg} --namespace-name {namespacename} --name {authoname}') - # Delete Namespace list by ResourceGroup + # Delete Namespace self.cmd('relay namespace delete --resource-group {rg} --name {namespacename}') @ResourceGroupPreparer(name_prefix='cli_test_relay_wcfrelay') @@ -96,7 +96,7 @@ def test_relay_wcfrelay(self, resource_group): 'tier': 'Standard', 'authoname': self.create_random_name(prefix='cliAutho', length=20), 'defaultauthorizationrule': 'RootManageSharedAccessKey', - 'accessrights': 'Listen', + 'accessrights': 'Send', 'primary': 'PrimaryKey', 'secondary': 'SecondaryKey', 'wcfrelayname': self.create_random_name(prefix='relay-wcfrelaycli', length=25), @@ -118,47 +118,47 @@ def test_relay_wcfrelay(self, resource_group): # Create WCFRelay self.cmd( - 'relay wcfrelay create --resource-group {rg} --namespace-name {namespacename} --name {wcfrelayname} --relay-type {relaytype} --requires-client-authorization {requiresclientauthorization} --requires-transport-security {requirestransportsecurity} --user-metadata {usermetadata}', + 'relay wcf-relay create --resource-group {rg} --namespace-name {namespacename} --name {wcfrelayname} --relay-type {relaytype} --requires-client-authorization {requiresclientauthorization} --requires-transport-security {requirestransportsecurity} --user-metadata {usermetadata}', checks=[self.check('name', self.kwargs['wcfrelayname'])]) # Get WCFRelay - self.cmd('relay wcfrelay show --resource-group {rg} --namespace-name {namespacename} --name {wcfrelayname}', + self.cmd('relay wcf-relay show --resource-group {rg} --namespace-name {namespacename} --name {wcfrelayname}', checks=[self.check('name', self.kwargs['wcfrelayname'])]) # WCFRelay List - listwcfrelay = self.cmd('relay wcfrelay list --resource-group {rg} --namespace-name {namespacename}').output + listwcfrelay = self.cmd('relay wcf-relay list --resource-group {rg} --namespace-name {namespacename}').output self.assertGreater(len(listwcfrelay), 0) # Create Authoriazation Rule self.cmd( - 'relay wcfrelay authorizationrule create --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname} --access-rights {accessrights}', + 'relay wcf-relay authorization-rule create --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname} --access-rights {accessrights}', checks=[self.check('name', self.kwargs['wcfrelayauthoname'])]) # Get Create Authorization Rule self.cmd( - 'relay wcfrelay authorizationrule show --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname}', + 'relay wcf-relay authorization-rule show --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname}', checks=[self.check('name', self.kwargs['wcfrelayauthoname'])]) # Get Authorization Rule Listkeys self.cmd( - 'relay wcfrelay authorizationrule keys list --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname}') + 'relay wcf-relay authorization-rule keys list --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname}') # Regeneratekeys - Primary regenrateprimarykeyresult = self.cmd( - 'relay wcfrelay authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname} --key-name {primary}') + 'relay wcf-relay authorization-rule keys renew --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname} --key-name {primary}') self.assertIsNotNone(regenrateprimarykeyresult) # Regeneratekeys - Secondary regenratesecondarykeyresult = self.cmd( - 'relay wcfrelay authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname} --key-name {secondary}') + 'relay wcf-relay authorization-rule keys renew --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname} --key-name {secondary}') self.assertIsNotNone(regenratesecondarykeyresult) # Delete WCFRelay AuthorizationRule self.cmd( - 'relay wcfrelay authorizationrule delete --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname}') + 'relay wcf-relay authorization-rule delete --resource-group {rg} --namespace-name {namespacename} --wcfrelay-name {wcfrelayname} --name {wcfrelayauthoname}') # Delete WCFRelay - self.cmd('relay wcfrelay delete --resource-group {rg} --namespace-name {namespacename} --name {wcfrelayname}') + self.cmd('relay wcf-relay delete --resource-group {rg} --namespace-name {namespacename} --name {wcfrelayname}') # Delete Namespace self.cmd('relay namespace delete --resource-group {rg} --name {namespacename}') @@ -174,7 +174,7 @@ def test_relay_hybridconnection(self, resource_group): 'tier': 'Standard', 'authoname': self.create_random_name(prefix='cliAutho', length=20), 'defaultauthorizationrule': 'RootManageSharedAccessKey', - 'accessrights': 'Listen', + 'accessrights': 'Send', 'primary': 'PrimaryKey', 'secondary': 'SecondaryKey', 'hybridconnectionname': self.create_random_name(prefix='relay-hybridcli', length=25), @@ -202,24 +202,24 @@ def test_relay_hybridconnection(self, resource_group): self.assertGreater(len(listhybirdconnection), 0) # Create Authoriazation Rule - self.cmd('relay hybrid-connections authorizationrule create --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname} --access-rights {accessrights}', checks=[self.check('name', self.kwargs['hybridconnectionauthoname'])]) + self.cmd('relay hybrid-connections authorization-rule create --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname} --access-rights {accessrights}', checks=[self.check('name', self.kwargs['hybridconnectionauthoname'])]) # Get Create Authorization Rule - self.cmd('relay hybrid-connections authorizationrule show --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname}', checks=[self.check('name', self.kwargs['hybridconnectionauthoname'])]) + self.cmd('relay hybrid-connections authorization-rule show --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname}', checks=[self.check('name', self.kwargs['hybridconnectionauthoname'])]) # Get Authorization Rule Listkeys - self.cmd('relay hybrid-connections authorizationrule keys list --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname}') + self.cmd('relay hybrid-connections authorization-rule keys list --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname}') # Regeneratekeys - Primary - regenrateprimarykeyresult = self.cmd('relay hybrid-connections authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname} --key-name {primary}') + regenrateprimarykeyresult = self.cmd('relay hybrid-connections authorization-rule keys renew --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname} --key-name {primary}') self.assertIsNotNone(regenrateprimarykeyresult) # Regeneratekeys - Secondary - regenratesecondarykeyresult = self.cmd('relay hybrid-connections authorizationrule keys renew --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname} --key-name {secondary}') + regenratesecondarykeyresult = self.cmd('relay hybrid-connections authorization-rule keys renew --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname} --key-name {secondary}') self.assertIsNotNone(regenratesecondarykeyresult) # Delete Hybrid Connections AuthorizationRule - self.cmd('relay hybrid-connections authorizationrule delete --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname}') + self.cmd('relay hybrid-connections authorization-rule delete --resource-group {rg} --namespace-name {namespacename} --hybrid-connection-name {hybridconnectionname} --name {hybridconnectionauthoname}') # Delete Hybrid Connections self.cmd('relay hybrid-connections delete --resource-group {rg} --namespace-name {namespacename} --name {hybridconnectionname}')