Skip to content

Commit

Permalink
Generated from 7da6f1df387d4d302afafb5ef2decc3aa78cefa6
Browse files Browse the repository at this point in the history
Fix duplicate path in old Network API versions (#5003)
  • Loading branch information
AutorestCI committed Jan 9, 2019
1 parent 34a6c6c commit d69a1e5
Showing 1 changed file with 66 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,72 +292,6 @@ def get_long_running_output(response):
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'}

def get_shared_key(
self, resource_group_name, connection_shared_key_name, custom_headers=None, raw=False, **operation_config):
"""The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves
information about the specified virtual network gateway connection
shared key through Network resource provider.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param connection_shared_key_name: The virtual network gateway
connection shared key name.
:type connection_shared_key_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: ConnectionSharedKeyResult or ClientRawResponse if raw=true
:rtype:
~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKeyResult or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.get_shared_key.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'connectionSharedKeyName': self._serialize.url("connection_shared_key_name", connection_shared_key_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('ConnectionSharedKeyResult', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{connectionSharedKeyName}/sharedkey'}

def list(
self, resource_group_name, custom_headers=None, raw=False, **operation_config):
"""The List VirtualNetworkGatewayConnections operation retrieves all the
Expand Down Expand Up @@ -641,3 +575,69 @@ def get_long_running_output(response):
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'}

def get_shared_key(
self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config):
"""The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves
information about the specified virtual network gateway connection
shared key through Network resource provider.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_connection_name: The virtual network
gateway connection shared key name.
:type virtual_network_gateway_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<msrest:optionsforoperations>`.
:return: ConnectionSharedKeyResult or ClientRawResponse if raw=true
:rtype:
~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKeyResult or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.get_shared_key.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('ConnectionSharedKeyResult', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'}

0 comments on commit d69a1e5

Please sign in to comment.