Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(ipam): register serverless_container and serverless_function #852

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 1 commit into from
Feb 6, 2025
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
22 changes: 11 additions & 11 deletions scaleway-async/scaleway_async/ipam/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from scaleway_core.api import API
from scaleway_core.bridge import (
Region,
Region as ScwRegion,
)
from scaleway_core.utils import (
OneOfPossibility,
Expand Down Expand Up @@ -50,7 +50,7 @@ async def book_ip(
*,
source: Source,
is_ipv6: bool,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
project_id: Optional[str] = None,
address: Optional[str] = None,
tags: Optional[List[str]] = None,
Expand Down Expand Up @@ -105,7 +105,7 @@ async def release_ip(
self,
*,
ip_id: str,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
) -> None:
"""
Release an IP.
Expand Down Expand Up @@ -137,7 +137,7 @@ async def release_ip(
async def release_ip_set(
self,
*,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
ip_ids: Optional[List[str]] = None,
) -> None:
"""
Expand Down Expand Up @@ -172,7 +172,7 @@ async def get_ip(
self,
*,
ip_id: str,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
) -> IP:
"""
Get an IP.
Expand Down Expand Up @@ -206,7 +206,7 @@ async def update_ip(
self,
*,
ip_id: str,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
tags: Optional[List[str]] = None,
reverses: Optional[List[Reverse]] = None,
) -> IP:
Expand Down Expand Up @@ -252,7 +252,7 @@ async def update_ip(
async def list_i_ps(
self,
*,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
order_by: Optional[ListIPsRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
Expand Down Expand Up @@ -348,7 +348,7 @@ async def list_i_ps(
async def list_i_ps_all(
self,
*,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
order_by: Optional[ListIPsRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
Expand Down Expand Up @@ -436,7 +436,7 @@ async def attach_ip(
*,
ip_id: str,
resource: CustomResource,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
) -> IP:
"""
Attach IP to custom resource.
Expand Down Expand Up @@ -481,7 +481,7 @@ async def detach_ip(
*,
ip_id: str,
resource: CustomResource,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
) -> IP:
"""
Detach IP from a custom resource.
Expand Down Expand Up @@ -526,7 +526,7 @@ async def move_ip(
*,
ip_id: str,
from_resource: CustomResource,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
to_resource: Optional[CustomResource] = None,
) -> IP:
"""
Expand Down
28 changes: 15 additions & 13 deletions scaleway-async/scaleway_async/ipam/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from typing import List, Optional

from scaleway_core.bridge import (
Region,
Zone,
Region as ScwRegion,
Zone as ScwZone,
)
from scaleway_core.utils import (
StrEnumMeta,
Expand Down Expand Up @@ -48,6 +48,8 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta):
MGDB_INSTANCE = "mgdb_instance"
APPLE_SILICON_SERVER = "apple_silicon_server"
APPLE_SILICON_PRIVATE_NIC = "apple_silicon_private_nic"
SERVERLESS_CONTAINER = "serverless_container"
SERVERLESS_FUNCTION = "serverless_function"

def __str__(self) -> str:
return str(self.value)
Expand Down Expand Up @@ -143,7 +145,7 @@ class IP:
Array of reverses associated with the IP.
"""

region: Region
region: ScwRegion
"""
Region of the IP.
"""
Expand All @@ -168,7 +170,7 @@ class IP:
Resource which the IP is attached to.
"""

zone: Optional[Zone]
zone: Optional[ScwZone]
"""
Zone of the IP, if zonal.
"""
Expand All @@ -186,7 +188,7 @@ class AttachIPRequest:
Custom resource to be attached to the IP.
"""

region: Optional[Region]
region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
"""
Expand All @@ -204,7 +206,7 @@ class BookIPRequest:
Request an IPv6 instead of an IPv4.
"""

region: Optional[Region]
region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
"""
Expand Down Expand Up @@ -242,7 +244,7 @@ class DetachIPRequest:
Custom resource currently attached to the IP.
"""

region: Optional[Region]
region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
"""
Expand All @@ -255,15 +257,15 @@ class GetIPRequest:
IP ID.
"""

region: Optional[Region]
region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
"""


@dataclass
class ListIPsRequest:
region: Optional[Region]
region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
"""
Expand Down Expand Up @@ -374,7 +376,7 @@ class MoveIPRequest:
Custom resource currently attached to the IP.
"""

region: Optional[Region]
region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
"""
Expand All @@ -392,15 +394,15 @@ class ReleaseIPRequest:
IP ID.
"""

region: Optional[Region]
region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
"""


@dataclass
class ReleaseIPSetRequest:
region: Optional[Region]
region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
"""
Expand All @@ -415,7 +417,7 @@ class UpdateIPRequest:
IP ID.
"""

region: Optional[Region]
region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
"""
Expand Down
22 changes: 11 additions & 11 deletions scaleway/scaleway/ipam/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from scaleway_core.api import API
from scaleway_core.bridge import (
Region,
Region as ScwRegion,
)
from scaleway_core.utils import (
OneOfPossibility,
Expand Down Expand Up @@ -50,7 +50,7 @@ def book_ip(
*,
source: Source,
is_ipv6: bool,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
project_id: Optional[str] = None,
address: Optional[str] = None,
tags: Optional[List[str]] = None,
Expand Down Expand Up @@ -105,7 +105,7 @@ def release_ip(
self,
*,
ip_id: str,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
) -> None:
"""
Release an IP.
Expand Down Expand Up @@ -137,7 +137,7 @@ def release_ip(
def release_ip_set(
self,
*,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
ip_ids: Optional[List[str]] = None,
) -> None:
"""
Expand Down Expand Up @@ -172,7 +172,7 @@ def get_ip(
self,
*,
ip_id: str,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
) -> IP:
"""
Get an IP.
Expand Down Expand Up @@ -206,7 +206,7 @@ def update_ip(
self,
*,
ip_id: str,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
tags: Optional[List[str]] = None,
reverses: Optional[List[Reverse]] = None,
) -> IP:
Expand Down Expand Up @@ -252,7 +252,7 @@ def update_ip(
def list_i_ps(
self,
*,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
order_by: Optional[ListIPsRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
Expand Down Expand Up @@ -348,7 +348,7 @@ def list_i_ps(
def list_i_ps_all(
self,
*,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
order_by: Optional[ListIPsRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
Expand Down Expand Up @@ -436,7 +436,7 @@ def attach_ip(
*,
ip_id: str,
resource: CustomResource,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
) -> IP:
"""
Attach IP to custom resource.
Expand Down Expand Up @@ -481,7 +481,7 @@ def detach_ip(
*,
ip_id: str,
resource: CustomResource,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
) -> IP:
"""
Detach IP from a custom resource.
Expand Down Expand Up @@ -526,7 +526,7 @@ def move_ip(
*,
ip_id: str,
from_resource: CustomResource,
region: Optional[Region] = None,
region: Optional[ScwRegion] = None,
to_resource: Optional[CustomResource] = None,
) -> IP:
"""
Expand Down
Loading