scaleway_async.vpc.v2 package

Submodules

scaleway_async.vpc.v2.api module

class scaleway_async.vpc.v2.api.VpcV2API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage your Virtual Private Clouds (VPCs) and Private Networks.

async add_subnets(*, private_network_id: str, region: Optional[str] = None, subnets: Optional[List[str]] = None) AddSubnetsResponse

Add subnets to a Private Network. Add new subnets to an existing Private Network. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config. :param subnets: Private Network subnets CIDR. :return: AddSubnetsResponse

Usage:

result = await api.add_subnets(
    private_network_id="example",
)
async create_private_network(*, region: Optional[str] = None, name: Optional[str] = None, project_id: Optional[str] = None, tags: Optional[List[str]] = None, subnets: Optional[List[str]] = None, vpc_id: Optional[str] = None) PrivateNetwork

Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources which are in the same region. :param region: Region to target. If none is passed will use default region from the config. :param name: Name for the Private Network. :param project_id: Scaleway Project in which to create the Private Network. :param tags: Tags for the Private Network. :param subnets: Private Network subnets CIDR. :param vpc_id: VPC in which to create the Private Network. :return: PrivateNetwork

Usage:

result = await api.create_private_network()
async create_route(*, description: str, vpc_id: str, destination: str, region: Optional[str] = None, tags: Optional[List[str]] = None, nexthop_resource_id: Optional[str] = None, nexthop_private_network_id: Optional[str] = None) Route

Create a Route. Create a new custom Route. :param description: Route description. :param vpc_id: VPC the Route belongs to. :param destination: Destination of the Route. :param region: Region to target. If none is passed will use default region from the config. :param tags: Tags of the Route. :param nexthop_resource_id: ID of the nexthop resource. :param nexthop_private_network_id: ID of the nexthop private network. :return: Route

Usage:

result = await api.create_route(
    description="example",
    vpc_id="example",
    destination="example",
)
async create_vpc(*, enable_routing: bool, region: Optional[str] = None, name: Optional[str] = None, project_id: Optional[str] = None, tags: Optional[List[str]] = None) VPC

Create a VPC. Create a new VPC in the specified region. :param enable_routing: Enable routing between Private Networks in the VPC. :param region: Region to target. If none is passed will use default region from the config. :param name: Name for the VPC. :param project_id: Scaleway Project in which to create the VPC. :param tags: Tags for the VPC. :return: VPC

Usage:

result = await api.create_vpc(
    enable_routing=False,
)
async delete_private_network(*, private_network_id: str, region: Optional[str] = None) None

Delete a Private Network. Delete an existing Private Network. Note that you must first detach all resources from the network, in order to delete it. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = await api.delete_private_network(
    private_network_id="example",
)
async delete_route(*, route_id: str, region: Optional[str] = None) None

Delete a Route. Delete a Route specified by its Route ID. :param route_id: Route ID. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = await api.delete_route(
    route_id="example",
)
async delete_subnets(*, private_network_id: str, region: Optional[str] = None, subnets: Optional[List[str]] = None) DeleteSubnetsResponse

Delete subnets from a Private Network. Delete the specified subnets from a Private Network. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config. :param subnets: Private Network subnets CIDR. :return: DeleteSubnetsResponse

Usage:

result = await api.delete_subnets(
    private_network_id="example",
)
async delete_vpc(*, vpc_id: str, region: Optional[str] = None) None

Delete a VPC. Delete a VPC specified by its VPC ID. :param vpc_id: VPC ID. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = await api.delete_vpc(
    vpc_id="example",
)
async enable_dhcp(*, private_network_id: str, region: Optional[str] = None) PrivateNetwork

Enable DHCP on a Private Network. Enable DHCP managed on an existing Private Network. Note that you will not be able to deactivate it afterwards. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config. :return: PrivateNetwork

Usage:

result = await api.enable_dhcp(
    private_network_id="example",
)
async enable_routing(*, vpc_id: str, region: Optional[str] = None) VPC

Enable routing on a VPC. Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards. :param vpc_id: VPC ID. :param region: Region to target. If none is passed will use default region from the config. :return: VPC

Usage:

result = await api.enable_routing(
    vpc_id="example",
)
async get_acl(*, vpc_id: str, is_ipv6: bool, region: Optional[str] = None) GetAclResponse

Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID. :param vpc_id: ID of the Network ACL’s VPC. :param is_ipv6: Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type. :param region: Region to target. If none is passed will use default region from the config. :return: GetAclResponse

Usage:

result = await api.get_acl(
    vpc_id="example",
    is_ipv6=False,
)
async get_private_network(*, private_network_id: str, region: Optional[str] = None) PrivateNetwork

Get a Private Network. Retrieve information about an existing Private Network, specified by its Private Network ID. Its full details are returned in the response object. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config. :return: PrivateNetwork

Usage:

result = await api.get_private_network(
    private_network_id="example",
)
async get_route(*, route_id: str, region: Optional[str] = None) Route

Get a Route. Retrieve details of an existing Route, specified by its Route ID. :param route_id: Route ID. :param region: Region to target. If none is passed will use default region from the config. :return: Route

Usage:

result = await api.get_route(
    route_id="example",
)
async get_vpc(*, vpc_id: str, region: Optional[str] = None) VPC

Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID. :param vpc_id: VPC ID. :param region: Region to target. If none is passed will use default region from the config. :return: VPC

Usage:

result = await api.get_vpc(
    vpc_id="example",
)
async list_private_networks(*, region: Optional[str] = None, order_by: Optional[ListPrivateNetworksRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, private_network_ids: Optional[List[str]] = None, vpc_id: Optional[str] = None, dhcp_enabled: Optional[bool] = None) ListPrivateNetworksResponse

List Private Networks. List existing Private Networks in the specified region. By default, the Private Networks returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned Private Networks. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of Private Networks to return per page. :param name: Name to filter for. Only Private Networks with names containing this string will be returned. :param tags: Tags to filter for. Only Private Networks with one or more matching tags will be returned. :param organization_id: Organization ID to filter for. Only Private Networks belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only Private Networks belonging to this Project will be returned. :param private_network_ids: Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned. :param vpc_id: VPC ID to filter for. Only Private Networks belonging to this VPC will be returned. :param dhcp_enabled: DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned. :return: ListPrivateNetworksResponse

Usage:

result = await api.list_private_networks()
async list_private_networks_all(*, region: Optional[str] = None, order_by: Optional[ListPrivateNetworksRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, private_network_ids: Optional[List[str]] = None, vpc_id: Optional[str] = None, dhcp_enabled: Optional[bool] = None) List[PrivateNetwork]

List Private Networks. List existing Private Networks in the specified region. By default, the Private Networks returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned Private Networks. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of Private Networks to return per page. :param name: Name to filter for. Only Private Networks with names containing this string will be returned. :param tags: Tags to filter for. Only Private Networks with one or more matching tags will be returned. :param organization_id: Organization ID to filter for. Only Private Networks belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only Private Networks belonging to this Project will be returned. :param private_network_ids: Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned. :param vpc_id: VPC ID to filter for. Only Private Networks belonging to this VPC will be returned. :param dhcp_enabled: DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned. :return: List[PrivateNetwork]

Usage:

result = await api.list_private_networks_all()
async list_subnets(*, region: Optional[str] = None, order_by: Optional[ListSubnetsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, subnet_ids: Optional[List[str]] = None, 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: 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: ListSubnetsResponse

Usage:

result = await api.list_subnets()
async list_subnets_all(*, region: Optional[str] = None, order_by: Optional[ListSubnetsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, subnet_ids: Optional[List[str]] = None, 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: 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: List[Subnet]

Usage:

result = await api.list_subnets_all()
async list_vp_cs(*, region: Optional[str] = None, order_by: Optional[ListVPCsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, is_default: Optional[bool] = None, routing_enabled: Optional[bool] = None) ListVPCsResponse

List VPCs. List existing VPCs in the specified region. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned VPCs. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of VPCs to return per page. :param name: Name to filter for. Only VPCs with names containing this string will be returned. :param tags: Tags to filter for. Only VPCs with one or more matching tags will be returned. :param organization_id: Organization ID to filter for. Only VPCs belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only VPCs belonging to this Project will be returned. :param is_default: Defines whether to filter only for VPCs which are the default one for their Project. :param routing_enabled: Defines whether to filter only for VPCs which route traffic between their Private Networks. :return: ListVPCsResponse

Usage:

result = await api.list_vp_cs()
async list_vp_cs_all(*, region: Optional[str] = None, order_by: Optional[ListVPCsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, is_default: Optional[bool] = None, routing_enabled: Optional[bool] = None) List[VPC]

List VPCs. List existing VPCs in the specified region. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned VPCs. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of VPCs to return per page. :param name: Name to filter for. Only VPCs with names containing this string will be returned. :param tags: Tags to filter for. Only VPCs with one or more matching tags will be returned. :param organization_id: Organization ID to filter for. Only VPCs belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only VPCs belonging to this Project will be returned. :param is_default: Defines whether to filter only for VPCs which are the default one for their Project. :param routing_enabled: Defines whether to filter only for VPCs which route traffic between their Private Networks. :return: List[VPC]

Usage:

result = await api.list_vp_cs_all()
async set_acl(*, vpc_id: str, rules: List[AclRule], is_ipv6: bool, default_policy: Action, region: Optional[str] = None) SetAclResponse

Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC. :param vpc_id: ID of the Network ACL’s VPC. :param rules: List of Network ACL rules. :param is_ipv6: Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type. :param default_policy: Action to take for packets which do not match any rules. :param region: Region to target. If none is passed will use default region from the config. :return: SetAclResponse

Usage:

result = await api.set_acl(
    vpc_id="example",
    rules=[],
    is_ipv6=False,
    default_policy=Action.unknown_action,
)
async update_private_network(*, private_network_id: str, region: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None) PrivateNetwork

Update Private Network. Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config. :param name: Name for the Private Network. :param tags: Tags for the Private Network. :return: PrivateNetwork

Usage:

result = await api.update_private_network(
    private_network_id="example",
)
async update_route(*, route_id: str, region: Optional[str] = None, description: Optional[str] = None, tags: Optional[List[str]] = None, destination: Optional[str] = None, nexthop_resource_id: Optional[str] = None, nexthop_private_network_id: Optional[str] = None) Route

Update Route. Update parameters of the specified Route. :param route_id: Route ID. :param region: Region to target. If none is passed will use default region from the config. :param description: Route description. :param tags: Tags of the Route. :param destination: Destination of the Route. :param nexthop_resource_id: ID of the nexthop resource. :param nexthop_private_network_id: ID of the nexthop private network. :return: Route

Usage:

result = await api.update_route(
    route_id="example",
)
async update_vpc(*, vpc_id: str, region: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None) VPC

Update VPC. Update parameters including name and tags of the specified VPC. :param vpc_id: VPC ID. :param region: Region to target. If none is passed will use default region from the config. :param name: Name for the VPC. :param tags: Tags for the VPC. :return: VPC

Usage:

result = await api.update_vpc(
    vpc_id="example",
)

scaleway_async.vpc.v2.marshalling module

scaleway_async.vpc.v2.marshalling.marshal_AclRule(request: AclRule, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.vpc.v2.marshalling.marshal_AddSubnetsRequest(request: AddSubnetsRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.vpc.v2.marshalling.marshal_CreatePrivateNetworkRequest(request: CreatePrivateNetworkRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.vpc.v2.marshalling.marshal_CreateRouteRequest(request: CreateRouteRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.vpc.v2.marshalling.marshal_CreateVPCRequest(request: CreateVPCRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.vpc.v2.marshalling.marshal_DeleteSubnetsRequest(request: DeleteSubnetsRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.vpc.v2.marshalling.marshal_SetAclRequest(request: SetAclRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.vpc.v2.marshalling.marshal_UpdatePrivateNetworkRequest(request: UpdatePrivateNetworkRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.vpc.v2.marshalling.marshal_UpdateRouteRequest(request: UpdateRouteRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.vpc.v2.marshalling.marshal_UpdateVPCRequest(request: UpdateVPCRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.vpc.v2.marshalling.unmarshal_AclRule(data: Any) AclRule
scaleway_async.vpc.v2.marshalling.unmarshal_AddSubnetsResponse(data: Any) AddSubnetsResponse
scaleway_async.vpc.v2.marshalling.unmarshal_DeleteSubnetsResponse(data: Any) DeleteSubnetsResponse
scaleway_async.vpc.v2.marshalling.unmarshal_GetAclResponse(data: Any) GetAclResponse
scaleway_async.vpc.v2.marshalling.unmarshal_ListPrivateNetworksResponse(data: Any) ListPrivateNetworksResponse
scaleway_async.vpc.v2.marshalling.unmarshal_ListSubnetsResponse(data: Any) ListSubnetsResponse
scaleway_async.vpc.v2.marshalling.unmarshal_ListVPCsResponse(data: Any) ListVPCsResponse
scaleway_async.vpc.v2.marshalling.unmarshal_PrivateNetwork(data: Any) PrivateNetwork
scaleway_async.vpc.v2.marshalling.unmarshal_Route(data: Any) Route
scaleway_async.vpc.v2.marshalling.unmarshal_SetAclResponse(data: Any) SetAclResponse
scaleway_async.vpc.v2.marshalling.unmarshal_Subnet(data: Any) Subnet
scaleway_async.vpc.v2.marshalling.unmarshal_VPC(data: Any) VPC

scaleway_async.vpc.v2.types module

class scaleway_async.vpc.v2.types.AclRule(protocol: 'AclRuleProtocol', source: 'str', src_port_low: 'int', src_port_high: 'int', destination: 'str', dst_port_low: 'int', dst_port_high: 'int', action: 'Action', description: 'Optional[str]')

Bases: object

action: Action

Policy to apply to the packet.

description: Optional[str]

Rule description.

destination: str

Destination IP range to which this rule applies (CIDR notation with subnet mask).

dst_port_high: int

Ending port of the destination port range to which this rule applies (inclusive).

dst_port_low: int

Starting port of the destination port range to which this rule applies (inclusive).

protocol: AclRuleProtocol

Protocol to which this rule applies.

source: str

Source IP range to which this rule applies (CIDR notation with subnet mask).

src_port_high: int

Ending port of the source port range to which this rule applies (inclusive).

src_port_low: int

Starting port of the source port range to which this rule applies (inclusive).

class scaleway_async.vpc.v2.types.AclRuleProtocol(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

ANY = 'any'
ICMP = 'icmp'
TCP = 'tcp'
UDP = 'udp'
class scaleway_async.vpc.v2.types.Action(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

ACCEPT = 'accept'
DROP = 'drop'
UNKNOWN_ACTION = 'unknown_action'
class scaleway_async.vpc.v2.types.AddSubnetsRequest(private_network_id: 'str', region: 'Optional[ScwRegion]', subnets: 'Optional[List[str]]')

Bases: object

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

subnets: Optional[List[str]]

Private Network subnets CIDR.

class scaleway_async.vpc.v2.types.AddSubnetsResponse(subnets: 'List[str]')

Bases: object

subnets: List[str]
class scaleway_async.vpc.v2.types.CreatePrivateNetworkRequest(region: 'Optional[ScwRegion]', name: 'Optional[str]', project_id: 'Optional[str]', tags: 'Optional[List[str]]', subnets: 'Optional[List[str]]', vpc_id: 'Optional[str]')

Bases: object

name: Optional[str]

Name for the Private Network.

project_id: Optional[str]

Scaleway Project in which to create the Private Network.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

subnets: Optional[List[str]]

Private Network subnets CIDR.

tags: Optional[List[str]]

Tags for the Private Network.

vpc_id: Optional[str]

VPC in which to create the Private Network.

class scaleway_async.vpc.v2.types.CreateRouteRequest(description: 'str', vpc_id: 'str', destination: 'str', region: 'Optional[ScwRegion]', tags: 'Optional[List[str]]', nexthop_resource_id: 'Optional[str]', nexthop_private_network_id: 'Optional[str]')

Bases: object

description: str

Route description.

destination: str

Destination of the Route.

nexthop_private_network_id: Optional[str]

ID of the nexthop private network.

nexthop_resource_id: Optional[str]

ID of the nexthop resource.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

tags: Optional[List[str]]

Tags of the Route.

vpc_id: str

VPC the Route belongs to.

class scaleway_async.vpc.v2.types.CreateVPCRequest(enable_routing: 'bool', region: 'Optional[ScwRegion]', name: 'Optional[str]', project_id: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

enable_routing: bool

Enable routing between Private Networks in the VPC.

name: Optional[str]

Name for the VPC.

project_id: Optional[str]

Scaleway Project in which to create the VPC.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

tags: Optional[List[str]]

Tags for the VPC.

class scaleway_async.vpc.v2.types.DeletePrivateNetworkRequest(private_network_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

class scaleway_async.vpc.v2.types.DeleteRouteRequest(route_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: Optional[str]

Region to target. If none is passed will use default region from the config.

route_id: str

Route ID.

class scaleway_async.vpc.v2.types.DeleteSubnetsRequest(private_network_id: 'str', region: 'Optional[ScwRegion]', subnets: 'Optional[List[str]]')

Bases: object

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

subnets: Optional[List[str]]

Private Network subnets CIDR.

class scaleway_async.vpc.v2.types.DeleteSubnetsResponse(subnets: 'List[str]')

Bases: object

subnets: List[str]
class scaleway_async.vpc.v2.types.DeleteVPCRequest(vpc_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: Optional[str]

Region to target. If none is passed will use default region from the config.

vpc_id: str

VPC ID.

class scaleway_async.vpc.v2.types.EnableDHCPRequest(private_network_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

class scaleway_async.vpc.v2.types.EnableRoutingRequest(vpc_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: Optional[str]

Region to target. If none is passed will use default region from the config.

vpc_id: str

VPC ID.

class scaleway_async.vpc.v2.types.GetAclRequest(vpc_id: 'str', is_ipv6: 'bool', region: 'Optional[ScwRegion]')

Bases: object

is_ipv6: bool

Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

vpc_id: str

ID of the Network ACL’s VPC.

class scaleway_async.vpc.v2.types.GetAclResponse(rules: 'List[AclRule]', default_policy: 'Action')

Bases: object

default_policy: Action
rules: List[AclRule]
class scaleway_async.vpc.v2.types.GetPrivateNetworkRequest(private_network_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

class scaleway_async.vpc.v2.types.GetRouteRequest(route_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: Optional[str]

Region to target. If none is passed will use default region from the config.

route_id: str

Route ID.

class scaleway_async.vpc.v2.types.GetVPCRequest(vpc_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: Optional[str]

Region to target. If none is passed will use default region from the config.

vpc_id: str

VPC ID.

class scaleway_async.vpc.v2.types.ListPrivateNetworksRequest(region: 'Optional[ScwRegion]', order_by: 'Optional[ListPrivateNetworksRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', name: 'Optional[str]', tags: 'Optional[List[str]]', organization_id: 'Optional[str]', project_id: 'Optional[str]', private_network_ids: 'Optional[List[str]]', vpc_id: 'Optional[str]', dhcp_enabled: 'Optional[bool]')

Bases: object

dhcp_enabled: Optional[bool]

DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned.

name: Optional[str]

Name to filter for. Only Private Networks with names containing this string will be returned.

order_by: Optional[ListPrivateNetworksRequestOrderBy]

Sort order of the returned Private Networks.

organization_id: Optional[str]

Organization ID to filter for. Only Private Networks belonging to this Organization will be returned.

page: Optional[int]

Page number to return, from the paginated results.

page_size: Optional[int]

Maximum number of Private Networks to return per page.

private_network_ids: Optional[List[str]]

Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned.

project_id: Optional[str]

Project ID to filter for. Only Private Networks belonging to this Project will be returned.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

tags: Optional[List[str]]

Tags to filter for. Only Private Networks with one or more matching tags will be returned.

vpc_id: Optional[str]

VPC ID to filter for. Only Private Networks belonging to this VPC will be returned.

class scaleway_async.vpc.v2.types.ListPrivateNetworksRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway_async.vpc.v2.types.ListPrivateNetworksResponse(private_networks: 'List[PrivateNetwork]', total_count: 'int')

Bases: object

private_networks: List[PrivateNetwork]
total_count: int
class scaleway_async.vpc.v2.types.ListSubnetsRequest(region: 'Optional[ScwRegion]', order_by: 'Optional[ListSubnetsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', organization_id: 'Optional[str]', project_id: 'Optional[str]', subnet_ids: 'Optional[List[str]]', vpc_id: 'Optional[str]')

Bases: object

order_by: Optional[ListSubnetsRequestOrderBy]

Sort order of the returned subnets.

organization_id: Optional[str]

Organization ID to filter for. Only subnets belonging to this Organization will be returned.

page: Optional[int]

Page number to return, from the paginated results.

page_size: Optional[int]

Maximum number of Private Networks to return per page.

project_id: Optional[str]

Project ID to filter for. Only subnets belonging to this Project will be returned.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

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.

class scaleway_async.vpc.v2.types.ListSubnetsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
class scaleway_async.vpc.v2.types.ListSubnetsResponse(subnets: 'List[Subnet]', total_count: 'int')

Bases: object

subnets: List[Subnet]
total_count: int
class scaleway_async.vpc.v2.types.ListVPCsRequest(region: 'Optional[ScwRegion]', order_by: 'Optional[ListVPCsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', name: 'Optional[str]', tags: 'Optional[List[str]]', organization_id: 'Optional[str]', project_id: 'Optional[str]', is_default: 'Optional[bool]', routing_enabled: 'Optional[bool]')

Bases: object

is_default: Optional[bool]

Defines whether to filter only for VPCs which are the default one for their Project.

name: Optional[str]

Name to filter for. Only VPCs with names containing this string will be returned.

order_by: Optional[ListVPCsRequestOrderBy]

Sort order of the returned VPCs.

organization_id: Optional[str]

Organization ID to filter for. Only VPCs belonging to this Organization will be returned.

page: Optional[int]

Page number to return, from the paginated results.

page_size: Optional[int]

Maximum number of VPCs to return per page.

project_id: Optional[str]

Project ID to filter for. Only VPCs belonging to this Project will be returned.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

routing_enabled: Optional[bool]

Defines whether to filter only for VPCs which route traffic between their Private Networks.

tags: Optional[List[str]]

Tags to filter for. Only VPCs with one or more matching tags will be returned.

class scaleway_async.vpc.v2.types.ListVPCsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway_async.vpc.v2.types.ListVPCsResponse(vpcs: 'List[VPC]', total_count: 'int')

Bases: object

total_count: int
vpcs: List[VPC]
class scaleway_async.vpc.v2.types.PrivateNetwork(id: 'str', name: 'str', organization_id: 'str', project_id: 'str', region: 'ScwRegion', tags: 'List[str]', subnets: 'List[Subnet]', vpc_id: 'str', dhcp_enabled: 'bool', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Date the Private Network was created.

dhcp_enabled: bool

Defines whether managed DHCP is enabled for this Private Network.

id: str

Private Network ID.

name: str

Private Network name.

organization_id: str

Scaleway Organization the Private Network belongs to.

project_id: str

Scaleway Project the Private Network belongs to.

region: str

Region in which the Private Network is available.

subnets: List[Subnet]

Private Network subnets.

tags: List[str]

Tags of the Private Network.

updated_at: Optional[datetime]

Date the Private Network was last modified.

vpc_id: str

VPC the Private Network belongs to.

class scaleway_async.vpc.v2.types.Route(id: 'str', description: 'str', tags: 'List[str]', vpc_id: 'str', destination: 'str', is_read_only: 'bool', region: 'ScwRegion', nexthop_resource_id: 'Optional[str]', nexthop_private_network_id: 'Optional[str]', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Date the Route was created.

description: str

Route description.

destination: str

Destination of the Route.

id: str

Route ID.

is_read_only: bool

Defines whether the route can be modified or deleted by the user.

nexthop_private_network_id: Optional[str]

ID of the nexthop private network.

nexthop_resource_id: Optional[str]

ID of the nexthop resource.

region: str

Region of the Route.

tags: List[str]

Tags of the Route.

updated_at: Optional[datetime]

Date the Route was last modified.

vpc_id: str

VPC the Route belongs to.

class scaleway_async.vpc.v2.types.SetAclRequest(vpc_id: 'str', rules: 'List[AclRule]', is_ipv6: 'bool', default_policy: 'Action', region: 'Optional[ScwRegion]')

Bases: object

default_policy: Action

Action to take for packets which do not match any rules.

is_ipv6: bool

Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

rules: List[AclRule]

List of Network ACL rules.

vpc_id: str

ID of the Network ACL’s VPC.

class scaleway_async.vpc.v2.types.SetAclResponse(rules: 'List[AclRule]', default_policy: 'Action')

Bases: object

default_policy: Action
rules: List[AclRule]
class scaleway_async.vpc.v2.types.Subnet(id: 'str', subnet: 'str', project_id: 'str', private_network_id: 'str', vpc_id: 'str', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Subnet creation date.

id: str

ID of the subnet.

private_network_id: str

Private Network the subnet belongs to.

project_id: str

Scaleway Project the subnet belongs to.

subnet: str

Subnet CIDR.

updated_at: Optional[datetime]

Subnet last modification date.

vpc_id: str

VPC the subnet belongs to.

class scaleway_async.vpc.v2.types.UpdatePrivateNetworkRequest(private_network_id: 'str', region: 'Optional[ScwRegion]', name: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Name for the Private Network.

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

tags: Optional[List[str]]

Tags for the Private Network.

class scaleway_async.vpc.v2.types.UpdateRouteRequest(route_id: 'str', region: 'Optional[ScwRegion]', description: 'Optional[str]', tags: 'Optional[List[str]]', destination: 'Optional[str]', nexthop_resource_id: 'Optional[str]', nexthop_private_network_id: 'Optional[str]')

Bases: object

description: Optional[str]

Route description.

destination: Optional[str]

Destination of the Route.

nexthop_private_network_id: Optional[str]

ID of the nexthop private network.

nexthop_resource_id: Optional[str]

ID of the nexthop resource.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

route_id: str

Route ID.

tags: Optional[List[str]]

Tags of the Route.

class scaleway_async.vpc.v2.types.UpdateVPCRequest(vpc_id: 'str', region: 'Optional[ScwRegion]', name: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Name for the VPC.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

tags: Optional[List[str]]

Tags for the VPC.

vpc_id: str

VPC ID.

class scaleway_async.vpc.v2.types.VPC(id: 'str', name: 'str', organization_id: 'str', project_id: 'str', region: 'ScwRegion', tags: 'List[str]', is_default: 'bool', private_network_count: 'int', routing_enabled: 'bool', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Date the VPC was created.

id: str

VPC ID.

is_default: bool

Defines whether the VPC is the default one for its Project.

name: str

VPC name.

organization_id: str

Scaleway Organization the VPC belongs to.

private_network_count: int

Number of Private Networks within this VPC.

project_id: str

Scaleway Project the VPC belongs to.

region: str

Region of the VPC.

routing_enabled: bool

Defines whether the VPC routes traffic between its Private Networks.

tags: List[str]

Tags for the VPC.

updated_at: Optional[datetime]

Date the VPC was last modified.

Module contents

class scaleway_async.vpc.v2.AclRule(protocol: 'AclRuleProtocol', source: 'str', src_port_low: 'int', src_port_high: 'int', destination: 'str', dst_port_low: 'int', dst_port_high: 'int', action: 'Action', description: 'Optional[str]')

Bases: object

action: Action

Policy to apply to the packet.

description: Optional[str]

Rule description.

destination: str

Destination IP range to which this rule applies (CIDR notation with subnet mask).

dst_port_high: int

Ending port of the destination port range to which this rule applies (inclusive).

dst_port_low: int

Starting port of the destination port range to which this rule applies (inclusive).

protocol: AclRuleProtocol

Protocol to which this rule applies.

source: str

Source IP range to which this rule applies (CIDR notation with subnet mask).

src_port_high: int

Ending port of the source port range to which this rule applies (inclusive).

src_port_low: int

Starting port of the source port range to which this rule applies (inclusive).

class scaleway_async.vpc.v2.AclRuleProtocol(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

ANY = 'any'
ICMP = 'icmp'
TCP = 'tcp'
UDP = 'udp'
class scaleway_async.vpc.v2.Action(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

ACCEPT = 'accept'
DROP = 'drop'
UNKNOWN_ACTION = 'unknown_action'
class scaleway_async.vpc.v2.AddSubnetsRequest(private_network_id: 'str', region: 'Optional[ScwRegion]', subnets: 'Optional[List[str]]')

Bases: object

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

subnets: Optional[List[str]]

Private Network subnets CIDR.

class scaleway_async.vpc.v2.AddSubnetsResponse(subnets: 'List[str]')

Bases: object

subnets: List[str]
class scaleway_async.vpc.v2.CreatePrivateNetworkRequest(region: 'Optional[ScwRegion]', name: 'Optional[str]', project_id: 'Optional[str]', tags: 'Optional[List[str]]', subnets: 'Optional[List[str]]', vpc_id: 'Optional[str]')

Bases: object

name: Optional[str]

Name for the Private Network.

project_id: Optional[str]

Scaleway Project in which to create the Private Network.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

subnets: Optional[List[str]]

Private Network subnets CIDR.

tags: Optional[List[str]]

Tags for the Private Network.

vpc_id: Optional[str]

VPC in which to create the Private Network.

class scaleway_async.vpc.v2.CreateRouteRequest(description: 'str', vpc_id: 'str', destination: 'str', region: 'Optional[ScwRegion]', tags: 'Optional[List[str]]', nexthop_resource_id: 'Optional[str]', nexthop_private_network_id: 'Optional[str]')

Bases: object

description: str

Route description.

destination: str

Destination of the Route.

nexthop_private_network_id: Optional[str]

ID of the nexthop private network.

nexthop_resource_id: Optional[str]

ID of the nexthop resource.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

tags: Optional[List[str]]

Tags of the Route.

vpc_id: str

VPC the Route belongs to.

class scaleway_async.vpc.v2.CreateVPCRequest(enable_routing: 'bool', region: 'Optional[ScwRegion]', name: 'Optional[str]', project_id: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

enable_routing: bool

Enable routing between Private Networks in the VPC.

name: Optional[str]

Name for the VPC.

project_id: Optional[str]

Scaleway Project in which to create the VPC.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

tags: Optional[List[str]]

Tags for the VPC.

class scaleway_async.vpc.v2.DeletePrivateNetworkRequest(private_network_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

class scaleway_async.vpc.v2.DeleteRouteRequest(route_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: Optional[str]

Region to target. If none is passed will use default region from the config.

route_id: str

Route ID.

class scaleway_async.vpc.v2.DeleteSubnetsRequest(private_network_id: 'str', region: 'Optional[ScwRegion]', subnets: 'Optional[List[str]]')

Bases: object

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

subnets: Optional[List[str]]

Private Network subnets CIDR.

class scaleway_async.vpc.v2.DeleteSubnetsResponse(subnets: 'List[str]')

Bases: object

subnets: List[str]
class scaleway_async.vpc.v2.DeleteVPCRequest(vpc_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: Optional[str]

Region to target. If none is passed will use default region from the config.

vpc_id: str

VPC ID.

class scaleway_async.vpc.v2.EnableDHCPRequest(private_network_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

class scaleway_async.vpc.v2.EnableRoutingRequest(vpc_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: Optional[str]

Region to target. If none is passed will use default region from the config.

vpc_id: str

VPC ID.

class scaleway_async.vpc.v2.GetAclRequest(vpc_id: 'str', is_ipv6: 'bool', region: 'Optional[ScwRegion]')

Bases: object

is_ipv6: bool

Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

vpc_id: str

ID of the Network ACL’s VPC.

class scaleway_async.vpc.v2.GetAclResponse(rules: 'List[AclRule]', default_policy: 'Action')

Bases: object

default_policy: Action
rules: List[AclRule]
class scaleway_async.vpc.v2.GetPrivateNetworkRequest(private_network_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

class scaleway_async.vpc.v2.GetRouteRequest(route_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: Optional[str]

Region to target. If none is passed will use default region from the config.

route_id: str

Route ID.

class scaleway_async.vpc.v2.GetVPCRequest(vpc_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: Optional[str]

Region to target. If none is passed will use default region from the config.

vpc_id: str

VPC ID.

class scaleway_async.vpc.v2.ListPrivateNetworksRequest(region: 'Optional[ScwRegion]', order_by: 'Optional[ListPrivateNetworksRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', name: 'Optional[str]', tags: 'Optional[List[str]]', organization_id: 'Optional[str]', project_id: 'Optional[str]', private_network_ids: 'Optional[List[str]]', vpc_id: 'Optional[str]', dhcp_enabled: 'Optional[bool]')

Bases: object

dhcp_enabled: Optional[bool]

DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned.

name: Optional[str]

Name to filter for. Only Private Networks with names containing this string will be returned.

order_by: Optional[ListPrivateNetworksRequestOrderBy]

Sort order of the returned Private Networks.

organization_id: Optional[str]

Organization ID to filter for. Only Private Networks belonging to this Organization will be returned.

page: Optional[int]

Page number to return, from the paginated results.

page_size: Optional[int]

Maximum number of Private Networks to return per page.

private_network_ids: Optional[List[str]]

Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned.

project_id: Optional[str]

Project ID to filter for. Only Private Networks belonging to this Project will be returned.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

tags: Optional[List[str]]

Tags to filter for. Only Private Networks with one or more matching tags will be returned.

vpc_id: Optional[str]

VPC ID to filter for. Only Private Networks belonging to this VPC will be returned.

class scaleway_async.vpc.v2.ListPrivateNetworksRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway_async.vpc.v2.ListPrivateNetworksResponse(private_networks: 'List[PrivateNetwork]', total_count: 'int')

Bases: object

private_networks: List[PrivateNetwork]
total_count: int
class scaleway_async.vpc.v2.ListSubnetsRequest(region: 'Optional[ScwRegion]', order_by: 'Optional[ListSubnetsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', organization_id: 'Optional[str]', project_id: 'Optional[str]', subnet_ids: 'Optional[List[str]]', vpc_id: 'Optional[str]')

Bases: object

order_by: Optional[ListSubnetsRequestOrderBy]

Sort order of the returned subnets.

organization_id: Optional[str]

Organization ID to filter for. Only subnets belonging to this Organization will be returned.

page: Optional[int]

Page number to return, from the paginated results.

page_size: Optional[int]

Maximum number of Private Networks to return per page.

project_id: Optional[str]

Project ID to filter for. Only subnets belonging to this Project will be returned.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

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.

class scaleway_async.vpc.v2.ListSubnetsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
class scaleway_async.vpc.v2.ListSubnetsResponse(subnets: 'List[Subnet]', total_count: 'int')

Bases: object

subnets: List[Subnet]
total_count: int
class scaleway_async.vpc.v2.ListVPCsRequest(region: 'Optional[ScwRegion]', order_by: 'Optional[ListVPCsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', name: 'Optional[str]', tags: 'Optional[List[str]]', organization_id: 'Optional[str]', project_id: 'Optional[str]', is_default: 'Optional[bool]', routing_enabled: 'Optional[bool]')

Bases: object

is_default: Optional[bool]

Defines whether to filter only for VPCs which are the default one for their Project.

name: Optional[str]

Name to filter for. Only VPCs with names containing this string will be returned.

order_by: Optional[ListVPCsRequestOrderBy]

Sort order of the returned VPCs.

organization_id: Optional[str]

Organization ID to filter for. Only VPCs belonging to this Organization will be returned.

page: Optional[int]

Page number to return, from the paginated results.

page_size: Optional[int]

Maximum number of VPCs to return per page.

project_id: Optional[str]

Project ID to filter for. Only VPCs belonging to this Project will be returned.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

routing_enabled: Optional[bool]

Defines whether to filter only for VPCs which route traffic between their Private Networks.

tags: Optional[List[str]]

Tags to filter for. Only VPCs with one or more matching tags will be returned.

class scaleway_async.vpc.v2.ListVPCsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway_async.vpc.v2.ListVPCsResponse(vpcs: 'List[VPC]', total_count: 'int')

Bases: object

total_count: int
vpcs: List[VPC]
class scaleway_async.vpc.v2.PrivateNetwork(id: 'str', name: 'str', organization_id: 'str', project_id: 'str', region: 'ScwRegion', tags: 'List[str]', subnets: 'List[Subnet]', vpc_id: 'str', dhcp_enabled: 'bool', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Date the Private Network was created.

dhcp_enabled: bool

Defines whether managed DHCP is enabled for this Private Network.

id: str

Private Network ID.

name: str

Private Network name.

organization_id: str

Scaleway Organization the Private Network belongs to.

project_id: str

Scaleway Project the Private Network belongs to.

region: str

Region in which the Private Network is available.

subnets: List[Subnet]

Private Network subnets.

tags: List[str]

Tags of the Private Network.

updated_at: Optional[datetime]

Date the Private Network was last modified.

vpc_id: str

VPC the Private Network belongs to.

class scaleway_async.vpc.v2.Route(id: 'str', description: 'str', tags: 'List[str]', vpc_id: 'str', destination: 'str', is_read_only: 'bool', region: 'ScwRegion', nexthop_resource_id: 'Optional[str]', nexthop_private_network_id: 'Optional[str]', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Date the Route was created.

description: str

Route description.

destination: str

Destination of the Route.

id: str

Route ID.

is_read_only: bool

Defines whether the route can be modified or deleted by the user.

nexthop_private_network_id: Optional[str]

ID of the nexthop private network.

nexthop_resource_id: Optional[str]

ID of the nexthop resource.

region: str

Region of the Route.

tags: List[str]

Tags of the Route.

updated_at: Optional[datetime]

Date the Route was last modified.

vpc_id: str

VPC the Route belongs to.

class scaleway_async.vpc.v2.SetAclRequest(vpc_id: 'str', rules: 'List[AclRule]', is_ipv6: 'bool', default_policy: 'Action', region: 'Optional[ScwRegion]')

Bases: object

default_policy: Action

Action to take for packets which do not match any rules.

is_ipv6: bool

Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

rules: List[AclRule]

List of Network ACL rules.

vpc_id: str

ID of the Network ACL’s VPC.

class scaleway_async.vpc.v2.SetAclResponse(rules: 'List[AclRule]', default_policy: 'Action')

Bases: object

default_policy: Action
rules: List[AclRule]
class scaleway_async.vpc.v2.Subnet(id: 'str', subnet: 'str', project_id: 'str', private_network_id: 'str', vpc_id: 'str', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Subnet creation date.

id: str

ID of the subnet.

private_network_id: str

Private Network the subnet belongs to.

project_id: str

Scaleway Project the subnet belongs to.

subnet: str

Subnet CIDR.

updated_at: Optional[datetime]

Subnet last modification date.

vpc_id: str

VPC the subnet belongs to.

class scaleway_async.vpc.v2.UpdatePrivateNetworkRequest(private_network_id: 'str', region: 'Optional[ScwRegion]', name: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Name for the Private Network.

private_network_id: str

Private Network ID.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

tags: Optional[List[str]]

Tags for the Private Network.

class scaleway_async.vpc.v2.UpdateRouteRequest(route_id: 'str', region: 'Optional[ScwRegion]', description: 'Optional[str]', tags: 'Optional[List[str]]', destination: 'Optional[str]', nexthop_resource_id: 'Optional[str]', nexthop_private_network_id: 'Optional[str]')

Bases: object

description: Optional[str]

Route description.

destination: Optional[str]

Destination of the Route.

nexthop_private_network_id: Optional[str]

ID of the nexthop private network.

nexthop_resource_id: Optional[str]

ID of the nexthop resource.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

route_id: str

Route ID.

tags: Optional[List[str]]

Tags of the Route.

class scaleway_async.vpc.v2.UpdateVPCRequest(vpc_id: 'str', region: 'Optional[ScwRegion]', name: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Name for the VPC.

region: Optional[str]

Region to target. If none is passed will use default region from the config.

tags: Optional[List[str]]

Tags for the VPC.

vpc_id: str

VPC ID.

class scaleway_async.vpc.v2.VPC(id: 'str', name: 'str', organization_id: 'str', project_id: 'str', region: 'ScwRegion', tags: 'List[str]', is_default: 'bool', private_network_count: 'int', routing_enabled: 'bool', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Date the VPC was created.

id: str

VPC ID.

is_default: bool

Defines whether the VPC is the default one for its Project.

name: str

VPC name.

organization_id: str

Scaleway Organization the VPC belongs to.

private_network_count: int

Number of Private Networks within this VPC.

project_id: str

Scaleway Project the VPC belongs to.

region: str

Region of the VPC.

routing_enabled: bool

Defines whether the VPC routes traffic between its Private Networks.

tags: List[str]

Tags for the VPC.

updated_at: Optional[datetime]

Date the VPC was last modified.

class scaleway_async.vpc.v2.VpcV2API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage your Virtual Private Clouds (VPCs) and Private Networks.

async add_subnets(*, private_network_id: str, region: Optional[str] = None, subnets: Optional[List[str]] = None) AddSubnetsResponse

Add subnets to a Private Network. Add new subnets to an existing Private Network. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config. :param subnets: Private Network subnets CIDR. :return: AddSubnetsResponse

Usage:

result = await api.add_subnets(
    private_network_id="example",
)
async create_private_network(*, region: Optional[str] = None, name: Optional[str] = None, project_id: Optional[str] = None, tags: Optional[List[str]] = None, subnets: Optional[List[str]] = None, vpc_id: Optional[str] = None) PrivateNetwork

Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources which are in the same region. :param region: Region to target. If none is passed will use default region from the config. :param name: Name for the Private Network. :param project_id: Scaleway Project in which to create the Private Network. :param tags: Tags for the Private Network. :param subnets: Private Network subnets CIDR. :param vpc_id: VPC in which to create the Private Network. :return: PrivateNetwork

Usage:

result = await api.create_private_network()
async create_route(*, description: str, vpc_id: str, destination: str, region: Optional[str] = None, tags: Optional[List[str]] = None, nexthop_resource_id: Optional[str] = None, nexthop_private_network_id: Optional[str] = None) Route

Create a Route. Create a new custom Route. :param description: Route description. :param vpc_id: VPC the Route belongs to. :param destination: Destination of the Route. :param region: Region to target. If none is passed will use default region from the config. :param tags: Tags of the Route. :param nexthop_resource_id: ID of the nexthop resource. :param nexthop_private_network_id: ID of the nexthop private network. :return: Route

Usage:

result = await api.create_route(
    description="example",
    vpc_id="example",
    destination="example",
)
async create_vpc(*, enable_routing: bool, region: Optional[str] = None, name: Optional[str] = None, project_id: Optional[str] = None, tags: Optional[List[str]] = None) VPC

Create a VPC. Create a new VPC in the specified region. :param enable_routing: Enable routing between Private Networks in the VPC. :param region: Region to target. If none is passed will use default region from the config. :param name: Name for the VPC. :param project_id: Scaleway Project in which to create the VPC. :param tags: Tags for the VPC. :return: VPC

Usage:

result = await api.create_vpc(
    enable_routing=False,
)
async delete_private_network(*, private_network_id: str, region: Optional[str] = None) None

Delete a Private Network. Delete an existing Private Network. Note that you must first detach all resources from the network, in order to delete it. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = await api.delete_private_network(
    private_network_id="example",
)
async delete_route(*, route_id: str, region: Optional[str] = None) None

Delete a Route. Delete a Route specified by its Route ID. :param route_id: Route ID. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = await api.delete_route(
    route_id="example",
)
async delete_subnets(*, private_network_id: str, region: Optional[str] = None, subnets: Optional[List[str]] = None) DeleteSubnetsResponse

Delete subnets from a Private Network. Delete the specified subnets from a Private Network. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config. :param subnets: Private Network subnets CIDR. :return: DeleteSubnetsResponse

Usage:

result = await api.delete_subnets(
    private_network_id="example",
)
async delete_vpc(*, vpc_id: str, region: Optional[str] = None) None

Delete a VPC. Delete a VPC specified by its VPC ID. :param vpc_id: VPC ID. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = await api.delete_vpc(
    vpc_id="example",
)
async enable_dhcp(*, private_network_id: str, region: Optional[str] = None) PrivateNetwork

Enable DHCP on a Private Network. Enable DHCP managed on an existing Private Network. Note that you will not be able to deactivate it afterwards. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config. :return: PrivateNetwork

Usage:

result = await api.enable_dhcp(
    private_network_id="example",
)
async enable_routing(*, vpc_id: str, region: Optional[str] = None) VPC

Enable routing on a VPC. Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards. :param vpc_id: VPC ID. :param region: Region to target. If none is passed will use default region from the config. :return: VPC

Usage:

result = await api.enable_routing(
    vpc_id="example",
)
async get_acl(*, vpc_id: str, is_ipv6: bool, region: Optional[str] = None) GetAclResponse

Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID. :param vpc_id: ID of the Network ACL’s VPC. :param is_ipv6: Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type. :param region: Region to target. If none is passed will use default region from the config. :return: GetAclResponse

Usage:

result = await api.get_acl(
    vpc_id="example",
    is_ipv6=False,
)
async get_private_network(*, private_network_id: str, region: Optional[str] = None) PrivateNetwork

Get a Private Network. Retrieve information about an existing Private Network, specified by its Private Network ID. Its full details are returned in the response object. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config. :return: PrivateNetwork

Usage:

result = await api.get_private_network(
    private_network_id="example",
)
async get_route(*, route_id: str, region: Optional[str] = None) Route

Get a Route. Retrieve details of an existing Route, specified by its Route ID. :param route_id: Route ID. :param region: Region to target. If none is passed will use default region from the config. :return: Route

Usage:

result = await api.get_route(
    route_id="example",
)
async get_vpc(*, vpc_id: str, region: Optional[str] = None) VPC

Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID. :param vpc_id: VPC ID. :param region: Region to target. If none is passed will use default region from the config. :return: VPC

Usage:

result = await api.get_vpc(
    vpc_id="example",
)
async list_private_networks(*, region: Optional[str] = None, order_by: Optional[ListPrivateNetworksRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, private_network_ids: Optional[List[str]] = None, vpc_id: Optional[str] = None, dhcp_enabled: Optional[bool] = None) ListPrivateNetworksResponse

List Private Networks. List existing Private Networks in the specified region. By default, the Private Networks returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned Private Networks. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of Private Networks to return per page. :param name: Name to filter for. Only Private Networks with names containing this string will be returned. :param tags: Tags to filter for. Only Private Networks with one or more matching tags will be returned. :param organization_id: Organization ID to filter for. Only Private Networks belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only Private Networks belonging to this Project will be returned. :param private_network_ids: Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned. :param vpc_id: VPC ID to filter for. Only Private Networks belonging to this VPC will be returned. :param dhcp_enabled: DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned. :return: ListPrivateNetworksResponse

Usage:

result = await api.list_private_networks()
async list_private_networks_all(*, region: Optional[str] = None, order_by: Optional[ListPrivateNetworksRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, private_network_ids: Optional[List[str]] = None, vpc_id: Optional[str] = None, dhcp_enabled: Optional[bool] = None) List[PrivateNetwork]

List Private Networks. List existing Private Networks in the specified region. By default, the Private Networks returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned Private Networks. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of Private Networks to return per page. :param name: Name to filter for. Only Private Networks with names containing this string will be returned. :param tags: Tags to filter for. Only Private Networks with one or more matching tags will be returned. :param organization_id: Organization ID to filter for. Only Private Networks belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only Private Networks belonging to this Project will be returned. :param private_network_ids: Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned. :param vpc_id: VPC ID to filter for. Only Private Networks belonging to this VPC will be returned. :param dhcp_enabled: DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned. :return: List[PrivateNetwork]

Usage:

result = await api.list_private_networks_all()
async list_subnets(*, region: Optional[str] = None, order_by: Optional[ListSubnetsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, subnet_ids: Optional[List[str]] = None, 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: 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: ListSubnetsResponse

Usage:

result = await api.list_subnets()
async list_subnets_all(*, region: Optional[str] = None, order_by: Optional[ListSubnetsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, subnet_ids: Optional[List[str]] = None, 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: 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: List[Subnet]

Usage:

result = await api.list_subnets_all()
async list_vp_cs(*, region: Optional[str] = None, order_by: Optional[ListVPCsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, is_default: Optional[bool] = None, routing_enabled: Optional[bool] = None) ListVPCsResponse

List VPCs. List existing VPCs in the specified region. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned VPCs. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of VPCs to return per page. :param name: Name to filter for. Only VPCs with names containing this string will be returned. :param tags: Tags to filter for. Only VPCs with one or more matching tags will be returned. :param organization_id: Organization ID to filter for. Only VPCs belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only VPCs belonging to this Project will be returned. :param is_default: Defines whether to filter only for VPCs which are the default one for their Project. :param routing_enabled: Defines whether to filter only for VPCs which route traffic between their Private Networks. :return: ListVPCsResponse

Usage:

result = await api.list_vp_cs()
async list_vp_cs_all(*, region: Optional[str] = None, order_by: Optional[ListVPCsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, is_default: Optional[bool] = None, routing_enabled: Optional[bool] = None) List[VPC]

List VPCs. List existing VPCs in the specified region. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned VPCs. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of VPCs to return per page. :param name: Name to filter for. Only VPCs with names containing this string will be returned. :param tags: Tags to filter for. Only VPCs with one or more matching tags will be returned. :param organization_id: Organization ID to filter for. Only VPCs belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only VPCs belonging to this Project will be returned. :param is_default: Defines whether to filter only for VPCs which are the default one for their Project. :param routing_enabled: Defines whether to filter only for VPCs which route traffic between their Private Networks. :return: List[VPC]

Usage:

result = await api.list_vp_cs_all()
async set_acl(*, vpc_id: str, rules: List[AclRule], is_ipv6: bool, default_policy: Action, region: Optional[str] = None) SetAclResponse

Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC. :param vpc_id: ID of the Network ACL’s VPC. :param rules: List of Network ACL rules. :param is_ipv6: Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type. :param default_policy: Action to take for packets which do not match any rules. :param region: Region to target. If none is passed will use default region from the config. :return: SetAclResponse

Usage:

result = await api.set_acl(
    vpc_id="example",
    rules=[],
    is_ipv6=False,
    default_policy=Action.unknown_action,
)
async update_private_network(*, private_network_id: str, region: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None) PrivateNetwork

Update Private Network. Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID. :param private_network_id: Private Network ID. :param region: Region to target. If none is passed will use default region from the config. :param name: Name for the Private Network. :param tags: Tags for the Private Network. :return: PrivateNetwork

Usage:

result = await api.update_private_network(
    private_network_id="example",
)
async update_route(*, route_id: str, region: Optional[str] = None, description: Optional[str] = None, tags: Optional[List[str]] = None, destination: Optional[str] = None, nexthop_resource_id: Optional[str] = None, nexthop_private_network_id: Optional[str] = None) Route

Update Route. Update parameters of the specified Route. :param route_id: Route ID. :param region: Region to target. If none is passed will use default region from the config. :param description: Route description. :param tags: Tags of the Route. :param destination: Destination of the Route. :param nexthop_resource_id: ID of the nexthop resource. :param nexthop_private_network_id: ID of the nexthop private network. :return: Route

Usage:

result = await api.update_route(
    route_id="example",
)
async update_vpc(*, vpc_id: str, region: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None) VPC

Update VPC. Update parameters including name and tags of the specified VPC. :param vpc_id: VPC ID. :param region: Region to target. If none is passed will use default region from the config. :param name: Name for the VPC. :param tags: Tags for the VPC. :return: VPC

Usage:

result = await api.update_vpc(
    vpc_id="example",
)