Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR storage/resource-manager] Support nextLink for list container request. #5095

Merged
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 @@ -41,7 +41,7 @@ def __init__(self, client, config, serializer, deserializer):

def set_service_properties(
self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config):
"""Sets the properties of a storage account���s Blob service, including
"""Sets the properties of a storage accounts Blob service, including
properties for Storage Analytics and CORS (Cross-Origin Resource
Sharing) rules. .

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,32 @@


class ListContainerItems(Model):
"""The list of blob containers.
"""Response schema. Contains list of blobs returned, and if paging is
requested or required, a URL to next page of containers.

:param value: The list of blob containers.
:type value:
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar value: List of blobs containers returned.
:vartype value:
list[~azure.mgmt.storage.v2019_04_01.models.ListContainerItem]
:ivar next_link: Request URL that can be used to query next page of
containers. Returned when total number of requested containers exceed
maximum page size.
:vartype next_link: str
"""

_validation = {
'value': {'readonly': True},
'next_link': {'readonly': True},
}

_attribute_map = {
'value': {'key': 'value', 'type': '[ListContainerItem]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ListContainerItems, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
self.value = None
self.next_link = None
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,32 @@


class ListContainerItems(Model):
"""The list of blob containers.
"""Response schema. Contains list of blobs returned, and if paging is
requested or required, a URL to next page of containers.

:param value: The list of blob containers.
:type value:
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar value: List of blobs containers returned.
:vartype value:
list[~azure.mgmt.storage.v2019_04_01.models.ListContainerItem]
:ivar next_link: Request URL that can be used to query next page of
containers. Returned when total number of requested containers exceed
maximum page size.
:vartype next_link: str
"""

_validation = {
'value': {'readonly': True},
'next_link': {'readonly': True},
}

_attribute_map = {
'value': {'key': 'value', 'type': '[ListContainerItem]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}

def __init__(self, *, value=None, **kwargs) -> None:
def __init__(self, **kwargs) -> None:
super(ListContainerItems, self).__init__(**kwargs)
self.value = value
self.value = None
self.next_link = None
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def list(
self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, account_name, skip_token=None, maxpagesize=None, filter=None, custom_headers=None, raw=False, **operation_config):
"""Lists all containers and does not support a prefix like data plane.
Also SRP today does not return continuation token.

Expand All @@ -51,6 +51,15 @@ def list(
specified resource group. Storage account names must be between 3 and
24 characters in length and use numbers and lower-case letters only.
:type account_name: str
:param skip_token: Optional. Continuation token for the list
operation.
:type skip_token: str
:param maxpagesize: Optional. Specified maximum number of containers
that can be included in the list.
:type maxpagesize: str
:param filter: Optional. When specified, only container names starting
with the filter will be listed.
:type filter: 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 @@ -73,6 +82,12 @@ def list(
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1)
if skip_token is not None:
query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str')
if maxpagesize is not None:
query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str')
if filter is not None:
query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')

# Construct headers
header_parameters = {}
Expand Down