Skip to content

Commit a45ee94

Browse files
authored
Merge branch 'main' into update-python-workflow
2 parents 030daeb + 31f1ed0 commit a45ee94

File tree

10 files changed

+650
-102
lines changed

10 files changed

+650
-102
lines changed

scaleway-async/scaleway_async/container/v1beta1/api.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,8 +1156,8 @@ async def list_domains(
11561156
order_by: Optional[ListDomainsRequestOrderBy] = None,
11571157
) -> ListDomainsResponse:
11581158
"""
1159-
List all domain name bindings.
1160-
List all domain name bindings in a specified region.
1159+
List all custom domains.
1160+
List all custom domains in a specified region.
11611161
:param container_id: UUID of the container the domain belongs to.
11621162
:param region: Region to target. If none is passed will use default region from the config.
11631163
:param page: Page number.
@@ -1201,8 +1201,8 @@ async def list_domains_all(
12011201
order_by: Optional[ListDomainsRequestOrderBy] = None,
12021202
) -> List[Domain]:
12031203
"""
1204-
List all domain name bindings.
1205-
List all domain name bindings in a specified region.
1204+
List all custom domains.
1205+
List all custom domains in a specified region.
12061206
:param container_id: UUID of the container the domain belongs to.
12071207
:param region: Region to target. If none is passed will use default region from the config.
12081208
:param page: Page number.
@@ -1238,8 +1238,8 @@ async def get_domain(
12381238
region: Optional[Region] = None,
12391239
) -> Domain:
12401240
"""
1241-
Get a domain name binding.
1242-
Get a domain name binding for the container with the specified ID.
1241+
Get a custom domain.
1242+
Get a custom domain for the container with the specified ID.
12431243
:param domain_id: UUID of the domain to get.
12441244
:param region: Region to target. If none is passed will use default region from the config.
12451245
:return: :class:`Domain <Domain>`
@@ -1273,8 +1273,8 @@ async def wait_for_domain(
12731273
options: Optional[WaitForOptions[Domain, Union[bool, Awaitable[bool]]]] = None,
12741274
) -> Domain:
12751275
"""
1276-
Get a domain name binding.
1277-
Get a domain name binding for the container with the specified ID.
1276+
Get a custom domain.
1277+
Get a custom domain for the container with the specified ID.
12781278
:param domain_id: UUID of the domain to get.
12791279
:param region: Region to target. If none is passed will use default region from the config.
12801280
:return: :class:`Domain <Domain>`
@@ -1310,8 +1310,8 @@ async def create_domain(
13101310
region: Optional[Region] = None,
13111311
) -> Domain:
13121312
"""
1313-
Create a domain name binding.
1314-
Create a domain name binding for the container with the specified ID.
1313+
Create a custom domain.
1314+
Create a custom domain for the container with the specified ID.
13151315
:param hostname: Domain to assign.
13161316
:param container_id: UUID of the container to assign the domain to.
13171317
:param region: Region to target. If none is passed will use default region from the config.
@@ -1353,8 +1353,8 @@ async def delete_domain(
13531353
region: Optional[Region] = None,
13541354
) -> Domain:
13551355
"""
1356-
Delete a domain name binding.
1357-
Delete the domain name binding with the specific ID.
1356+
Delete a custom domain.
1357+
Delete the custom domain with the specific ID.
13581358
:param domain_id: UUID of the domain to delete.
13591359
:param region: Region to target. If none is passed will use default region from the config.
13601360
:return: :class:`Domain <Domain>`

scaleway-async/scaleway_async/vpcgw/v2/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@
1515
from .types import Gateway
1616
from .types import PatRule
1717
from .types import SetPatRulesRequestRule
18+
from .types import AddBastionAllowedIPsRequest
19+
from .types import AddBastionAllowedIPsResponse
1820
from .types import CreateGatewayNetworkRequest
1921
from .types import CreateGatewayRequest
2022
from .types import CreateIPRequest
2123
from .types import CreatePatRuleRequest
24+
from .types import DeleteBastionAllowedIPsRequest
2225
from .types import DeleteGatewayNetworkRequest
2326
from .types import DeleteGatewayRequest
2427
from .types import DeleteIPRequest
@@ -38,6 +41,8 @@
3841
from .types import ListPatRulesRequest
3942
from .types import ListPatRulesResponse
4043
from .types import RefreshSSHKeysRequest
44+
from .types import SetBastionAllowedIPsRequest
45+
from .types import SetBastionAllowedIPsResponse
4146
from .types import SetPatRulesRequest
4247
from .types import SetPatRulesResponse
4348
from .types import UpdateGatewayNetworkRequest
@@ -63,10 +68,13 @@
6368
"Gateway",
6469
"PatRule",
6570
"SetPatRulesRequestRule",
71+
"AddBastionAllowedIPsRequest",
72+
"AddBastionAllowedIPsResponse",
6673
"CreateGatewayNetworkRequest",
6774
"CreateGatewayRequest",
6875
"CreateIPRequest",
6976
"CreatePatRuleRequest",
77+
"DeleteBastionAllowedIPsRequest",
7078
"DeleteGatewayNetworkRequest",
7179
"DeleteGatewayRequest",
7280
"DeleteIPRequest",
@@ -86,6 +94,8 @@
8694
"ListPatRulesRequest",
8795
"ListPatRulesResponse",
8896
"RefreshSSHKeysRequest",
97+
"SetBastionAllowedIPsRequest",
98+
"SetBastionAllowedIPsResponse",
8999
"SetPatRulesRequest",
90100
"SetPatRulesResponse",
91101
"UpdateGatewayNetworkRequest",

scaleway-async/scaleway_async/vpcgw/v2/api.py

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
ListIPsRequestOrderBy,
2323
ListPatRulesRequestOrderBy,
2424
PatRuleProtocol,
25+
AddBastionAllowedIPsRequest,
26+
AddBastionAllowedIPsResponse,
2527
CreateGatewayNetworkRequest,
2628
CreateGatewayRequest,
2729
CreateIPRequest,
@@ -35,6 +37,8 @@
3537
ListIPsResponse,
3638
ListPatRulesResponse,
3739
PatRule,
40+
SetBastionAllowedIPsRequest,
41+
SetBastionAllowedIPsResponse,
3842
SetPatRulesRequest,
3943
SetPatRulesRequestRule,
4044
SetPatRulesResponse,
@@ -53,16 +57,20 @@
5357
unmarshal_IP,
5458
unmarshal_Gateway,
5559
unmarshal_PatRule,
60+
unmarshal_AddBastionAllowedIPsResponse,
5661
unmarshal_ListGatewayNetworksResponse,
5762
unmarshal_ListGatewayTypesResponse,
5863
unmarshal_ListGatewaysResponse,
5964
unmarshal_ListIPsResponse,
6065
unmarshal_ListPatRulesResponse,
66+
unmarshal_SetBastionAllowedIPsResponse,
6167
unmarshal_SetPatRulesResponse,
68+
marshal_AddBastionAllowedIPsRequest,
6269
marshal_CreateGatewayNetworkRequest,
6370
marshal_CreateGatewayRequest,
6471
marshal_CreateIPRequest,
6572
marshal_CreatePatRuleRequest,
73+
marshal_SetBastionAllowedIPsRequest,
6674
marshal_SetPatRulesRequest,
6775
marshal_UpdateGatewayNetworkRequest,
6876
marshal_UpdateGatewayRequest,
@@ -1383,3 +1391,122 @@ async def refresh_ssh_keys(
13831391

13841392
self._throw_on_error(res)
13851393
return unmarshal_Gateway(res.json())
1394+
1395+
async def add_bastion_allowed_i_ps(
1396+
self,
1397+
*,
1398+
gateway_id: str,
1399+
ip_range: str,
1400+
zone: Optional[Zone] = None,
1401+
) -> AddBastionAllowedIPsResponse:
1402+
"""
1403+
Add allowed IP range to SSH bastion.
1404+
Add an IP range (in CIDR notation) to be allowed to connect to the SSH bastion.
1405+
:param gateway_id: ID of the gateway to add the allowed IP range to.
1406+
:param ip_range: IP range allowed to connect to the SSH bastion.
1407+
:param zone: Zone to target. If none is passed will use default zone from the config.
1408+
:return: :class:`AddBastionAllowedIPsResponse <AddBastionAllowedIPsResponse>`
1409+
1410+
Usage:
1411+
::
1412+
1413+
result = await api.add_bastion_allowed_i_ps(
1414+
gateway_id="example",
1415+
ip_range="example",
1416+
)
1417+
"""
1418+
1419+
param_zone = validate_path_param("zone", zone or self.client.default_zone)
1420+
param_gateway_id = validate_path_param("gateway_id", gateway_id)
1421+
1422+
res = self._request(
1423+
"POST",
1424+
f"/vpc-gw/v2/zones/{param_zone}/gateways/{param_gateway_id}/bastion-allowed-ips",
1425+
body=marshal_AddBastionAllowedIPsRequest(
1426+
AddBastionAllowedIPsRequest(
1427+
gateway_id=gateway_id,
1428+
ip_range=ip_range,
1429+
zone=zone,
1430+
),
1431+
self.client,
1432+
),
1433+
)
1434+
1435+
self._throw_on_error(res)
1436+
return unmarshal_AddBastionAllowedIPsResponse(res.json())
1437+
1438+
async def set_bastion_allowed_i_ps(
1439+
self,
1440+
*,
1441+
gateway_id: str,
1442+
zone: Optional[Zone] = None,
1443+
ip_ranges: Optional[List[str]] = None,
1444+
) -> SetBastionAllowedIPsResponse:
1445+
"""
1446+
Set all IP ranges allowed for SSH bastion.
1447+
Set a definitive list of IP ranges (in CIDR notation) allowed to connect to the SSH bastion.
1448+
:param gateway_id: ID of the gateway on which to set the allowed IP range.
1449+
:param zone: Zone to target. If none is passed will use default zone from the config.
1450+
:param ip_ranges: New list of IP ranges (each range in CIDR notation) allowed to connect to the SSH bastion.
1451+
:return: :class:`SetBastionAllowedIPsResponse <SetBastionAllowedIPsResponse>`
1452+
1453+
Usage:
1454+
::
1455+
1456+
result = await api.set_bastion_allowed_i_ps(
1457+
gateway_id="example",
1458+
)
1459+
"""
1460+
1461+
param_zone = validate_path_param("zone", zone or self.client.default_zone)
1462+
param_gateway_id = validate_path_param("gateway_id", gateway_id)
1463+
1464+
res = self._request(
1465+
"PUT",
1466+
f"/vpc-gw/v2/zones/{param_zone}/gateways/{param_gateway_id}/bastion-allowed-ips",
1467+
body=marshal_SetBastionAllowedIPsRequest(
1468+
SetBastionAllowedIPsRequest(
1469+
gateway_id=gateway_id,
1470+
zone=zone,
1471+
ip_ranges=ip_ranges,
1472+
),
1473+
self.client,
1474+
),
1475+
)
1476+
1477+
self._throw_on_error(res)
1478+
return unmarshal_SetBastionAllowedIPsResponse(res.json())
1479+
1480+
async def delete_bastion_allowed_i_ps(
1481+
self,
1482+
*,
1483+
gateway_id: str,
1484+
ip_range: str,
1485+
zone: Optional[Zone] = None,
1486+
) -> None:
1487+
"""
1488+
Delete allowed IP range from SSH bastion.
1489+
Delete an IP range (defined in CIDR notation) from SSH bastion, so that it is no longer allowed to connect.
1490+
:param gateway_id: ID of the gateway on which to delete the allowed IP range.
1491+
:param ip_range: IP range to delete from SSH bastion's list of allowed IPs.
1492+
:param zone: Zone to target. If none is passed will use default zone from the config.
1493+
1494+
Usage:
1495+
::
1496+
1497+
result = await api.delete_bastion_allowed_i_ps(
1498+
gateway_id="example",
1499+
ip_range="example",
1500+
)
1501+
"""
1502+
1503+
param_zone = validate_path_param("zone", zone or self.client.default_zone)
1504+
param_gateway_id = validate_path_param("gateway_id", gateway_id)
1505+
param_ip_range = validate_path_param("ip_range", ip_range)
1506+
1507+
res = self._request(
1508+
"DELETE",
1509+
f"/vpc-gw/v2/zones/{param_zone}/gateways/{param_gateway_id}/bastion-allowed-ips/{param_ip_range}",
1510+
)
1511+
1512+
self._throw_on_error(res)

0 commit comments

Comments
 (0)