Skip to content

Commit

Permalink
feat(vpc/v2): add ListSubnets docs (#530)
Browse files Browse the repository at this point in the history
Co-authored-by: Yacine Fodil <105779815+yfodil@users.noreply.github.com>
  • Loading branch information
scaleway-bot and yfodil authored May 24, 2024
1 parent d040119 commit 0f4df59
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 30 deletions.
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

0 comments on commit 0f4df59

Please sign in to comment.