Skip to content

feat(vpc/v2): add ListSubnets docs #530

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

Merged
merged 2 commits into from
May 24, 2024
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
34 changes: 19 additions & 15 deletions scaleway-async/scaleway_async/vpc/v2/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,14 +749,16 @@ async def list_subnets(
vpc_id: Optional[str] = None,
) -> ListSubnetsResponse:
"""
List subnets.
List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
:param region: Region to target. If none is passed will use default region from the config.
:param order_by:
:param page:
:param page_size:
:param organization_id:
:param project_id:
:param subnet_ids:
:param vpc_id:
:param order_by: Sort order of the returned subnets.
:param page: Page number to return, from the paginated results.
:param page_size: Maximum number of Private Networks to return per page.
:param organization_id: Organization ID to filter for. Only subnets belonging to this Organization will be returned.
:param project_id: Project ID to filter for. Only subnets belonging to this Project will be returned.
:param subnet_ids: Subnet IDs to filter for. Only subnets matching the specified IDs will be returned.
:param vpc_id: VPC ID to filter for. Only subnets belonging to this VPC will be returned.
:return: :class:`ListSubnetsResponse <ListSubnetsResponse>`

Usage:
Expand Down Expand Up @@ -800,14 +802,16 @@ async def list_subnets_all(
vpc_id: Optional[str] = None,
) -> List[Subnet]:
"""
List subnets.
List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
:param region: Region to target. If none is passed will use default region from the config.
:param order_by:
:param page:
:param page_size:
:param organization_id:
:param project_id:
:param subnet_ids:
:param vpc_id:
:param order_by: Sort order of the returned subnets.
:param page: Page number to return, from the paginated results.
:param page_size: Maximum number of Private Networks to return per page.
:param organization_id: Organization ID to filter for. Only subnets belonging to this Organization will be returned.
:param project_id: Project ID to filter for. Only subnets belonging to this Project will be returned.
:param subnet_ids: Subnet IDs to filter for. Only subnets matching the specified IDs will be returned.
:param vpc_id: VPC ID to filter for. Only subnets belonging to this VPC will be returned.
:return: :class:`List[Subnet] <List[Subnet]>`

Usage:
Expand Down Expand Up @@ -840,7 +844,7 @@ async def set_subnets(
subnets: Optional[List[str]] = None,
) -> SetSubnetsResponse:
"""
Set the subnets of a Private Network.
Set a Private Network's subnets.
Set subnets for an existing Private Network. Note that the method is PUT and not PATCH. Any existing subnets will be removed in favor of the new specified set of subnets.
:param private_network_id: Private Network ID.
:param region: Region to target. If none is passed will use default region from the config.
Expand Down
21 changes: 21 additions & 0 deletions scaleway-async/scaleway_async/vpc/v2/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,18 +452,39 @@ class ListSubnetsRequest:
"""

order_by: Optional[ListSubnetsRequestOrderBy]
"""
Sort order of the returned subnets.
"""

page: Optional[int]
"""
Page number to return, from the paginated results.
"""

page_size: Optional[int]
"""
Maximum number of Private Networks to return per page.
"""

organization_id: Optional[str]
"""
Organization ID to filter for. Only subnets belonging to this Organization will be returned.
"""

project_id: Optional[str]
"""
Project ID to filter for. Only subnets belonging to this Project will be returned.
"""

subnet_ids: Optional[List[str]]
"""
Subnet IDs to filter for. Only subnets matching the specified IDs will be returned.
"""

vpc_id: Optional[str]
"""
VPC ID to filter for. Only subnets belonging to this VPC will be returned.
"""


@dataclass
Expand Down
34 changes: 19 additions & 15 deletions scaleway/scaleway/vpc/v2/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,14 +749,16 @@ def list_subnets(
vpc_id: Optional[str] = None,
) -> ListSubnetsResponse:
"""
List subnets.
List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
:param region: Region to target. If none is passed will use default region from the config.
:param order_by:
:param page:
:param page_size:
:param organization_id:
:param project_id:
:param subnet_ids:
:param vpc_id:
:param order_by: Sort order of the returned subnets.
:param page: Page number to return, from the paginated results.
:param page_size: Maximum number of Private Networks to return per page.
:param organization_id: Organization ID to filter for. Only subnets belonging to this Organization will be returned.
:param project_id: Project ID to filter for. Only subnets belonging to this Project will be returned.
:param subnet_ids: Subnet IDs to filter for. Only subnets matching the specified IDs will be returned.
:param vpc_id: VPC ID to filter for. Only subnets belonging to this VPC will be returned.
:return: :class:`ListSubnetsResponse <ListSubnetsResponse>`

Usage:
Expand Down Expand Up @@ -800,14 +802,16 @@ def list_subnets_all(
vpc_id: Optional[str] = None,
) -> List[Subnet]:
"""
List subnets.
List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
:param region: Region to target. If none is passed will use default region from the config.
:param order_by:
:param page:
:param page_size:
:param organization_id:
:param project_id:
:param subnet_ids:
:param vpc_id:
:param order_by: Sort order of the returned subnets.
:param page: Page number to return, from the paginated results.
:param page_size: Maximum number of Private Networks to return per page.
:param organization_id: Organization ID to filter for. Only subnets belonging to this Organization will be returned.
:param project_id: Project ID to filter for. Only subnets belonging to this Project will be returned.
:param subnet_ids: Subnet IDs to filter for. Only subnets matching the specified IDs will be returned.
:param vpc_id: VPC ID to filter for. Only subnets belonging to this VPC will be returned.
:return: :class:`List[Subnet] <List[Subnet]>`

Usage:
Expand Down Expand Up @@ -840,7 +844,7 @@ def set_subnets(
subnets: Optional[List[str]] = None,
) -> SetSubnetsResponse:
"""
Set the subnets of a Private Network.
Set a Private Network's subnets.
Set subnets for an existing Private Network. Note that the method is PUT and not PATCH. Any existing subnets will be removed in favor of the new specified set of subnets.
:param private_network_id: Private Network ID.
:param region: Region to target. If none is passed will use default region from the config.
Expand Down
21 changes: 21 additions & 0 deletions scaleway/scaleway/vpc/v2/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,18 +452,39 @@ class ListSubnetsRequest:
"""

order_by: Optional[ListSubnetsRequestOrderBy]
"""
Sort order of the returned subnets.
"""

page: Optional[int]
"""
Page number to return, from the paginated results.
"""

page_size: Optional[int]
"""
Maximum number of Private Networks to return per page.
"""

organization_id: Optional[str]
"""
Organization ID to filter for. Only subnets belonging to this Organization will be returned.
"""

project_id: Optional[str]
"""
Project ID to filter for. Only subnets belonging to this Project will be returned.
"""

subnet_ids: Optional[List[str]]
"""
Subnet IDs to filter for. Only subnets matching the specified IDs will be returned.
"""

vpc_id: Optional[str]
"""
VPC ID to filter for. Only subnets belonging to this VPC will be returned.
"""


@dataclass
Expand Down