Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"autorest": "1.2.2", "date": "2017-08-17T15:39:08Z", "version": ""}
{"autorest": "1.2.2", "date": "2017-08-31T19:59:21Z", "version": ""}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"autorest": "1.2.2", "date": "2017-08-17T15:40:07Z", "version": ""}
{"autorest": "1.2.2", "date": "2017-08-31T19:59:46Z", "version": ""}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"autorest": "1.2.2", "date": "2017-08-17T15:41:10Z", "version": ""}
{"autorest": "1.2.2", "date": "2017-08-31T20:00:15Z", "version": ""}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"autorest": "1.2.2", "date": "2017-08-17T15:42:19Z", "version": ""}
{"autorest": "1.2.2", "date": "2017-08-31T20:00:43Z", "version": ""}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"autorest": "1.2.2", "date": "2017-08-17T15:43:49Z", "version": ""}
{"autorest": "1.2.2", "date": "2017-08-31T20:01:20Z", "version": ""}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"autorest": "1.2.2", "date": "2017-08-17T16:04:55Z", "version": ""}
{"autorest": "1.2.2", "date": "2017-08-31T20:01:59Z", "version": ""}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class Usage(Model):
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: Resource identifier.
:vartype id: str
:ivar unit: An enum describing the unit of measurement. Default value:
"Count" .
:vartype unit: str
Expand All @@ -31,13 +33,15 @@ class Usage(Model):
"""

_validation = {
'id': {'readonly': True},
'unit': {'required': True, 'constant': True},
'current_value': {'required': True},
'limit': {'required': True},
'name': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'unit': {'key': 'unit', 'type': 'str'},
'current_value': {'key': 'currentValue', 'type': 'long'},
'limit': {'key': 'limit', 'type': 'long'},
Expand All @@ -47,6 +51,7 @@ class Usage(Model):
unit = "Count"

def __init__(self, current_value, limit, name):
self.id = None
self.current_value = current_value
self.limit = limit
self.name = name
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)

def check_dns_name_availability(
self, location, domain_name_label=None, custom_headers=None, raw=False, **operation_config):
"""Checks whether a domain name in the cloudapp.net zone is available for
use.
self, location, domain_name_label, custom_headers=None, raw=False, **operation_config):
"""Checks whether a domain name in the cloudapp.azure.com zone is
available for use.

:param location: The location of the domain name.
:type location: str
Expand Down Expand Up @@ -291,8 +291,7 @@ def check_dns_name_availability(

# Construct parameters
query_parameters = {}
if domain_name_label is not None:
query_parameters['domainNameLabel'] = self._serialize.query("domain_name_label", domain_name_label, 'str')
query_parameters['domainNameLabel'] = self._serialize.query("domain_name_label", domain_name_label, 'str')
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

# Construct headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer):

def list(
self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config):
"""Get all load balancers in a network interface.
"""List all load balancers in a network interface.

:param resource_group_name: The name of the resource group.
:type resource_group_name: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer):

def list(
self, location, custom_headers=None, raw=False, **operation_config):
"""Lists compute usages for a subscription.
"""List network usages for a subscription.

:param location: The location where resource usage is queried.
:type location: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,97 @@ def get_long_running_status(status_link, headers=None):

def get_long_running_output(response):

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

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('str', 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 get_vpn_profile_pacakge_url(
self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config):
"""Gets pre-generated VPN profile for P2S client of the virtual network
gateway in the specified resource group. The profile needs to be
generated first using generateVpnProfile.

:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_name: The name of the virtual network
gateway.
:type virtual_network_gateway_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:
:class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>`
instance that returns str or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if
raw=true
:rtype:
:class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>`
or :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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['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.post(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]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
Expand Down