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
2 changes: 2 additions & 0 deletions scaleway-async/scaleway_async/instance/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
from .types import ListVolumesTypesResponse
from .types import MigrationPlan
from .types import PlanBlockMigrationRequest
from .types import ReleaseIpToIpamRequest
from .types import ServerActionRequest
from .types import ServerActionResponse
from .types import ServerCompatibleTypes
Expand Down Expand Up @@ -380,6 +381,7 @@
"ListVolumesTypesResponse",
"MigrationPlan",
"PlanBlockMigrationRequest",
"ReleaseIpToIpamRequest",
"ServerActionRequest",
"ServerActionResponse",
"ServerCompatibleTypes",
Expand Down
31 changes: 31 additions & 0 deletions scaleway-async/scaleway_async/instance/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4223,3 +4223,34 @@ async def check_block_migration_organization_quotas(
)

self._throw_on_error(res)

async def release_ip_to_ipam(
self,
*,
ip_id: str,
zone: Optional[ScwZone] = None,
) -> None:
"""
Releases the reserved IP without deleting the reservation.
**The IP remains available in IPAM**, which means that it is still reserved by the Organization, and can be reattached to another resource (Instance or other product).
:param ip_id: ID of the IP you want to release from the Instance but retain in IPAM.
:param zone: Zone to target. If none is passed will use default zone from the config.

Usage:
::

result = await api.release_ip_to_ipam(
ip_id="example",
)
"""

param_zone = validate_path_param("zone", zone or self.client.default_zone)
param_ip_id = validate_path_param("ip_id", ip_id)

res = self._request(
"POST",
f"/instance/v1/zones/{param_zone}/ips/{param_ip_id}/release-to-ipam",
body={},
)

self._throw_on_error(res)
13 changes: 13 additions & 0 deletions scaleway-async/scaleway_async/instance/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2965,6 +2965,19 @@ class PlanBlockMigrationRequest:
snapshot_id: Optional[str] = None


@dataclass
class ReleaseIpToIpamRequest:
ip_id: str
"""
ID of the IP you want to release from the Instance but retain in IPAM.
"""

zone: Optional[ScwZone] = None
"""
Zone to target. If none is passed will use default zone from the config.
"""


@dataclass
class ServerActionRequest:
server_id: str
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/instance/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
from .types import ListVolumesTypesResponse
from .types import MigrationPlan
from .types import PlanBlockMigrationRequest
from .types import ReleaseIpToIpamRequest
from .types import ServerActionRequest
from .types import ServerActionResponse
from .types import ServerCompatibleTypes
Expand Down Expand Up @@ -380,6 +381,7 @@
"ListVolumesTypesResponse",
"MigrationPlan",
"PlanBlockMigrationRequest",
"ReleaseIpToIpamRequest",
"ServerActionRequest",
"ServerActionResponse",
"ServerCompatibleTypes",
Expand Down
31 changes: 31 additions & 0 deletions scaleway/scaleway/instance/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4223,3 +4223,34 @@ def check_block_migration_organization_quotas(
)

self._throw_on_error(res)

def release_ip_to_ipam(
self,
*,
ip_id: str,
zone: Optional[ScwZone] = None,
) -> None:
"""
Releases the reserved IP without deleting the reservation.
**The IP remains available in IPAM**, which means that it is still reserved by the Organization, and can be reattached to another resource (Instance or other product).
:param ip_id: ID of the IP you want to release from the Instance but retain in IPAM.
:param zone: Zone to target. If none is passed will use default zone from the config.

Usage:
::

result = api.release_ip_to_ipam(
ip_id="example",
)
"""

param_zone = validate_path_param("zone", zone or self.client.default_zone)
param_ip_id = validate_path_param("ip_id", ip_id)

res = self._request(
"POST",
f"/instance/v1/zones/{param_zone}/ips/{param_ip_id}/release-to-ipam",
body={},
)

self._throw_on_error(res)
13 changes: 13 additions & 0 deletions scaleway/scaleway/instance/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2965,6 +2965,19 @@ class PlanBlockMigrationRequest:
snapshot_id: Optional[str] = None


@dataclass
class ReleaseIpToIpamRequest:
ip_id: str
"""
ID of the IP you want to release from the Instance but retain in IPAM.
"""

zone: Optional[ScwZone] = None
"""
Zone to target. If none is passed will use default zone from the config.
"""


@dataclass
class ServerActionRequest:
server_id: str
Expand Down