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
22 changes: 20 additions & 2 deletions scaleway-async/scaleway_async/lb/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ async def create_lb(
project_id: Optional[str] = None,
name: Optional[str] = None,
ip_id: Optional[str] = None,
assign_flexible_ip: Optional[bool] = None,
ip_ids: Optional[List[str]] = None,
tags: Optional[List[str]] = None,
) -> Lb:
"""
Expand All @@ -324,6 +326,8 @@ async def create_lb(
:param name: Name for the Load Balancer.
:param description: Description for the Load Balancer.
:param ip_id: ID of an existing flexible IP address to attach to the Load Balancer.
:param assign_flexible_ip: Defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign).
:param ip_ids: List of IP IDs to attach to the Load Balancer.
:param tags: List of tags for the Load Balancer.
:param type_: Load Balancer commercial offer type. Use the Load Balancer types endpoint to retrieve a list of available offer types.
:param ssl_compatibility_level: Determines the minimal SSL version which needs to be supported on the client side, in an SSL/TLS offloading context. Intermediate is suitable for general-purpose servers with a variety of clients, recommended for almost all systems. Modern is suitable for services with clients that support TLS 1.3 and do not need backward compatibility. Old is compatible with a small number of very old clients and should be used only as a last resort.
Expand Down Expand Up @@ -356,6 +360,8 @@ async def create_lb(
project_id=project_id,
name=name or random_name(prefix="lb"),
ip_id=ip_id,
assign_flexible_ip=assign_flexible_ip,
ip_ids=ip_ids,
tags=tags,
),
self.client,
Expand Down Expand Up @@ -657,6 +663,7 @@ async def list_i_ps_all(
async def create_ip(
self,
*,
is_ipv6: bool,
region: Optional[Region] = None,
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
Expand All @@ -672,12 +679,13 @@ async def create_ip(

One-of ('project_identifier'): at most one of 'organization_id', 'project_id' could be set.
:param reverse: Reverse DNS (domain name) for the IP address.
:param is_ipv6: If true, creates a Flexible IP with an ipv6 address.
:return: :class:`Ip <Ip>`

Usage:
::

result = await api.create_ip()
result = await api.create_ip(is_ipv6=True)
"""

param_region = validate_path_param(
Expand All @@ -689,6 +697,7 @@ async def create_ip(
f"/lb/v1/regions/{param_region}/ips",
body=marshal_CreateIpRequest(
CreateIpRequest(
is_ipv6=is_ipv6,
region=region,
organization_id=organization_id,
project_id=project_id,
Expand Down Expand Up @@ -3235,6 +3244,8 @@ async def create_lb(
project_id: Optional[str] = None,
name: Optional[str] = None,
ip_id: Optional[str] = None,
assign_flexible_ip: Optional[bool] = None,
ip_ids: Optional[List[str]] = None,
tags: Optional[List[str]] = None,
) -> Lb:
"""
Expand All @@ -3250,6 +3261,8 @@ async def create_lb(
:param name: Name for the Load Balancer.
:param description: Description for the Load Balancer.
:param ip_id: ID of an existing flexible IP address to attach to the Load Balancer.
:param assign_flexible_ip: Defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign).
:param ip_ids: List of IP IDs to attach to the Load Balancer.
:param tags: List of tags for the Load Balancer.
:param type_: Load Balancer commercial offer type. Use the Load Balancer types endpoint to retrieve a list of available offer types.
:param ssl_compatibility_level: Determines the minimal SSL version which needs to be supported on the client side, in an SSL/TLS offloading context. Intermediate is suitable for general-purpose servers with a variety of clients, recommended for almost all systems. Modern is suitable for services with clients that support TLS 1.3 and do not need backward compatibility. Old is compatible with a small number of very old clients and should be used only as a last resort.
Expand Down Expand Up @@ -3280,6 +3293,8 @@ async def create_lb(
project_id=project_id,
name=name or random_name(prefix="lb"),
ip_id=ip_id,
assign_flexible_ip=assign_flexible_ip,
ip_ids=ip_ids,
tags=tags,
),
self.client,
Expand Down Expand Up @@ -3577,6 +3592,7 @@ async def list_i_ps_all(
async def create_ip(
self,
*,
is_ipv6: bool,
zone: Optional[Zone] = None,
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
Expand All @@ -3593,12 +3609,13 @@ async def create_ip(

One-of ('project_identifier'): at most one of 'organization_id', 'project_id' could be set.
:param reverse: Reverse DNS (domain name) for the IP address.
:param is_ipv6: If true, creates a Flexible IP with an ipv6 address.
:return: :class:`Ip <Ip>`

Usage:
::

result = await api.create_ip()
result = await api.create_ip(is_ipv6=True)
"""

param_zone = validate_path_param("zone", zone or self.client.default_zone)
Expand All @@ -3608,6 +3625,7 @@ async def create_ip(
f"/lb/v1/zones/{param_zone}/ips",
body=marshal_ZonedApiCreateIpRequest(
ZonedApiCreateIpRequest(
is_ipv6=is_ipv6,
zone=zone,
organization_id=organization_id,
project_id=project_id,
Expand Down
6 changes: 6 additions & 0 deletions scaleway-async/scaleway_async/lb/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,7 @@ def marshal_CreateIpRequest(
),
]
),
"is_ipv6": request.is_ipv6,
"reverse": request.reverse,
}

Expand Down Expand Up @@ -1603,8 +1604,10 @@ def marshal_CreateLbRequest(
),
]
),
"assign_flexible_ip": request.assign_flexible_ip,
"description": request.description,
"ip_id": request.ip_id,
"ip_ids": request.ip_ids,
"name": request.name,
"ssl_compatibility_level": SSLCompatibilityLevel(
request.ssl_compatibility_level
Expand Down Expand Up @@ -2054,6 +2057,7 @@ def marshal_ZonedApiCreateIpRequest(
),
]
),
"is_ipv6": request.is_ipv6,
"reverse": request.reverse,
}

Expand Down Expand Up @@ -2081,8 +2085,10 @@ def marshal_ZonedApiCreateLbRequest(
),
]
),
"assign_flexible_ip": request.assign_flexible_ip,
"description": request.description,
"ip_id": request.ip_id,
"ip_ids": request.ip_ids,
"name": request.name,
"ssl_compatibility_level": SSLCompatibilityLevel(
request.ssl_compatibility_level
Expand Down
34 changes: 33 additions & 1 deletion scaleway-async/scaleway_async/lb/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class AclActionRedirect:

target: str
"""
Redirect target. For a location redirect, you can use a URL e.g. `https://scaleway.com`. Using a scheme name (e.g. `https`, `http`, `ftp`, `git`) will replace the request's original scheme. This can be useful to implement HTTP to HTTPS redirects. Valid placeholders that can be used in a `location` redirect to preserve parts of the original request in the redirection URL are {{ host }}, {{ query }}, {{ path }} and {{ scheme }}.
Redirect target. For a location redirect, you can use a URL e.g. `https://scaleway.com`. Using a scheme name (e.g. `https`, `http`, `ftp`, `git`) will replace the request's original scheme. This can be useful to implement HTTP to HTTPS redirects. Valid placeholders that can be used in a `location` redirect to preserve parts of the original request in the redirection URL are \{\{ host \}\}, \{\{ query \}\}, \{\{ path \}\} and \{\{ scheme \}\}.
"""

code: Optional[int]
Expand Down Expand Up @@ -1660,6 +1660,17 @@ class CreateLbRequest:
ip_id: Optional[str]
"""
ID of an existing flexible IP address to attach to the Load Balancer.
:deprecated
"""

assign_flexible_ip: Optional[bool]
"""
Defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign).
"""

ip_ids: Optional[List[str]]
"""
List of IP IDs to attach to the Load Balancer.
"""

tags: Optional[List[str]]
Expand Down Expand Up @@ -1820,6 +1831,11 @@ class CreateIpRequest:
Reverse DNS (domain name) for the IP address.
"""

is_ipv6: bool
"""
If true, creates a Flexible IP with an ipv6 address.
"""


@dataclass
class GetIpRequest:
Expand Down Expand Up @@ -3185,6 +3201,17 @@ class ZonedApiCreateLbRequest:
ip_id: Optional[str]
"""
ID of an existing flexible IP address to attach to the Load Balancer.
:deprecated
"""

assign_flexible_ip: Optional[bool]
"""
Defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign).
"""

ip_ids: Optional[List[str]]
"""
List of IP IDs to attach to the Load Balancer.
"""

tags: Optional[List[str]]
Expand Down Expand Up @@ -3345,6 +3372,11 @@ class ZonedApiCreateIpRequest:
Reverse DNS (domain name) for the IP address.
"""

is_ipv6: bool
"""
If true, creates a Flexible IP with an ipv6 address.
"""


@dataclass
class ZonedApiGetIpRequest:
Expand Down
22 changes: 20 additions & 2 deletions scaleway/scaleway/lb/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ def create_lb(
project_id: Optional[str] = None,
name: Optional[str] = None,
ip_id: Optional[str] = None,
assign_flexible_ip: Optional[bool] = None,
ip_ids: Optional[List[str]] = None,
tags: Optional[List[str]] = None,
) -> Lb:
"""
Expand All @@ -324,6 +326,8 @@ def create_lb(
:param name: Name for the Load Balancer.
:param description: Description for the Load Balancer.
:param ip_id: ID of an existing flexible IP address to attach to the Load Balancer.
:param assign_flexible_ip: Defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign).
:param ip_ids: List of IP IDs to attach to the Load Balancer.
:param tags: List of tags for the Load Balancer.
:param type_: Load Balancer commercial offer type. Use the Load Balancer types endpoint to retrieve a list of available offer types.
:param ssl_compatibility_level: Determines the minimal SSL version which needs to be supported on the client side, in an SSL/TLS offloading context. Intermediate is suitable for general-purpose servers with a variety of clients, recommended for almost all systems. Modern is suitable for services with clients that support TLS 1.3 and do not need backward compatibility. Old is compatible with a small number of very old clients and should be used only as a last resort.
Expand Down Expand Up @@ -356,6 +360,8 @@ def create_lb(
project_id=project_id,
name=name or random_name(prefix="lb"),
ip_id=ip_id,
assign_flexible_ip=assign_flexible_ip,
ip_ids=ip_ids,
tags=tags,
),
self.client,
Expand Down Expand Up @@ -657,6 +663,7 @@ def list_i_ps_all(
def create_ip(
self,
*,
is_ipv6: bool,
region: Optional[Region] = None,
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
Expand All @@ -672,12 +679,13 @@ def create_ip(

One-of ('project_identifier'): at most one of 'organization_id', 'project_id' could be set.
:param reverse: Reverse DNS (domain name) for the IP address.
:param is_ipv6: If true, creates a Flexible IP with an ipv6 address.
:return: :class:`Ip <Ip>`

Usage:
::

result = api.create_ip()
result = api.create_ip(is_ipv6=True)
"""

param_region = validate_path_param(
Expand All @@ -689,6 +697,7 @@ def create_ip(
f"/lb/v1/regions/{param_region}/ips",
body=marshal_CreateIpRequest(
CreateIpRequest(
is_ipv6=is_ipv6,
region=region,
organization_id=organization_id,
project_id=project_id,
Expand Down Expand Up @@ -3233,6 +3242,8 @@ def create_lb(
project_id: Optional[str] = None,
name: Optional[str] = None,
ip_id: Optional[str] = None,
assign_flexible_ip: Optional[bool] = None,
ip_ids: Optional[List[str]] = None,
tags: Optional[List[str]] = None,
) -> Lb:
"""
Expand All @@ -3248,6 +3259,8 @@ def create_lb(
:param name: Name for the Load Balancer.
:param description: Description for the Load Balancer.
:param ip_id: ID of an existing flexible IP address to attach to the Load Balancer.
:param assign_flexible_ip: Defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign).
:param ip_ids: List of IP IDs to attach to the Load Balancer.
:param tags: List of tags for the Load Balancer.
:param type_: Load Balancer commercial offer type. Use the Load Balancer types endpoint to retrieve a list of available offer types.
:param ssl_compatibility_level: Determines the minimal SSL version which needs to be supported on the client side, in an SSL/TLS offloading context. Intermediate is suitable for general-purpose servers with a variety of clients, recommended for almost all systems. Modern is suitable for services with clients that support TLS 1.3 and do not need backward compatibility. Old is compatible with a small number of very old clients and should be used only as a last resort.
Expand Down Expand Up @@ -3278,6 +3291,8 @@ def create_lb(
project_id=project_id,
name=name or random_name(prefix="lb"),
ip_id=ip_id,
assign_flexible_ip=assign_flexible_ip,
ip_ids=ip_ids,
tags=tags,
),
self.client,
Expand Down Expand Up @@ -3575,6 +3590,7 @@ def list_i_ps_all(
def create_ip(
self,
*,
is_ipv6: bool,
zone: Optional[Zone] = None,
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
Expand All @@ -3591,12 +3607,13 @@ def create_ip(

One-of ('project_identifier'): at most one of 'organization_id', 'project_id' could be set.
:param reverse: Reverse DNS (domain name) for the IP address.
:param is_ipv6: If true, creates a Flexible IP with an ipv6 address.
:return: :class:`Ip <Ip>`

Usage:
::

result = api.create_ip()
result = api.create_ip(is_ipv6=True)
"""

param_zone = validate_path_param("zone", zone or self.client.default_zone)
Expand All @@ -3606,6 +3623,7 @@ def create_ip(
f"/lb/v1/zones/{param_zone}/ips",
body=marshal_ZonedApiCreateIpRequest(
ZonedApiCreateIpRequest(
is_ipv6=is_ipv6,
zone=zone,
organization_id=organization_id,
project_id=project_id,
Expand Down
6 changes: 6 additions & 0 deletions scaleway/scaleway/lb/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,7 @@ def marshal_CreateIpRequest(
),
]
),
"is_ipv6": request.is_ipv6,
"reverse": request.reverse,
}

Expand Down Expand Up @@ -1603,8 +1604,10 @@ def marshal_CreateLbRequest(
),
]
),
"assign_flexible_ip": request.assign_flexible_ip,
"description": request.description,
"ip_id": request.ip_id,
"ip_ids": request.ip_ids,
"name": request.name,
"ssl_compatibility_level": SSLCompatibilityLevel(
request.ssl_compatibility_level
Expand Down Expand Up @@ -2054,6 +2057,7 @@ def marshal_ZonedApiCreateIpRequest(
),
]
),
"is_ipv6": request.is_ipv6,
"reverse": request.reverse,
}

Expand Down Expand Up @@ -2081,8 +2085,10 @@ def marshal_ZonedApiCreateLbRequest(
),
]
),
"assign_flexible_ip": request.assign_flexible_ip,
"description": request.description,
"ip_id": request.ip_id,
"ip_ids": request.ip_ids,
"name": request.name,
"ssl_compatibility_level": SSLCompatibilityLevel(
request.ssl_compatibility_level
Expand Down
Loading