Skip to content
Merged
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
Expand Up @@ -38,15 +38,13 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def list_locations(
self, subscription_id, custom_headers=None, raw=False, **operation_config):
self, custom_headers=None, raw=False, **operation_config):
"""Gets all available geo-locations.

This operation provides all the locations that are available for
resource providers; however, each resource provider may support a
subset of this list.

:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -63,7 +61,7 @@ def internal_paging(next_link=None, raw=False):
# Construct URL
url = self.list_locations.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str')
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

Expand Down Expand Up @@ -109,11 +107,9 @@ def internal_paging(next_link=None, raw=False):
list_locations.metadata = {'url': '/subscriptions/{subscriptionId}/locations'}

def get(
self, subscription_id, custom_headers=None, raw=False, **operation_config):
self, custom_headers=None, raw=False, **operation_config):
"""Gets details about a specified subscription.

:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -128,7 +124,7 @@ def get(
# Construct URL
url = self.get.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str')
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ class SubscriptionClientConfiguration(AzureConfiguration):
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, base_url=None):
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'

Expand All @@ -43,6 +47,7 @@ def __init__(
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id


class SubscriptionClient(object):
Expand All @@ -59,13 +64,15 @@ class SubscriptionClient(object):
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, base_url=None):
self, credentials, subscription_id, base_url=None):

self.config = SubscriptionClientConfiguration(credentials, base_url)
self.config = SubscriptionClientConfiguration(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)}
Expand Down