scaleway.vpc.v1 package

Submodules

scaleway.vpc.v1.api module

class scaleway.vpc.v1.api.VpcV1API(client: Client, *, bypass_validation: bool = False)

Bases: API

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

create_private_network(*, zone: Optional[str] = None, name: Optional[str] = None, project_id: Optional[str] = None, tags: Optional[List[str]] = None, subnets: Optional[List[str]] = None) PrivateNetwork

Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources in the same Availability Zone. :param zone: Zone to target. If none is passed will use default zone 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. :return: PrivateNetwork

Usage:

result = api.create_private_network()
delete_private_network(*, private_network_id: str, zone: 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 zone: Zone to target. If none is passed will use default zone from the config.

Usage:

result = api.delete_private_network(
    private_network_id="example",
)
get_private_network(*, private_network_id: str, zone: 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 zone: Zone to target. If none is passed will use default zone from the config. :return: PrivateNetwork

Usage:

result = api.get_private_network(
    private_network_id="example",
)
list_private_networks(*, zone: 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, include_regional: Optional[bool] = None) ListPrivateNetworksResponse

List Private Networks. List existing Private Networks in a specified Availability Zone. 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 zone: Zone to target. If none is passed will use default zone 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 include_regional: Defines whether to include regional Private Networks in the response. :return: ListPrivateNetworksResponse

Usage:

result = api.list_private_networks()
list_private_networks_all(*, zone: 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, include_regional: Optional[bool] = None) List[PrivateNetwork]

List Private Networks. List existing Private Networks in a specified Availability Zone. 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 zone: Zone to target. If none is passed will use default zone 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 include_regional: Defines whether to include regional Private Networks in the response. :return: List[PrivateNetwork]

Usage:

result = api.list_private_networks_all()
update_private_network(*, private_network_id: str, zone: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None, subnets: 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 zone: Zone to target. If none is passed will use default zone from the config. :param name: Name of the private network. :param tags: Tags for the Private Network. :param subnets: Private Network subnets CIDR (deprecated). :return: PrivateNetwork

Usage:

result = api.update_private_network(
    private_network_id="example",
)

scaleway.vpc.v1.marshalling module

scaleway.vpc.v1.marshalling.marshal_CreatePrivateNetworkRequest(request: CreatePrivateNetworkRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.vpc.v1.marshalling.marshal_UpdatePrivateNetworkRequest(request: UpdatePrivateNetworkRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.vpc.v1.marshalling.unmarshal_ListPrivateNetworksResponse(data: Any) ListPrivateNetworksResponse
scaleway.vpc.v1.marshalling.unmarshal_PrivateNetwork(data: Any) PrivateNetwork

scaleway.vpc.v1.types module

class scaleway.vpc.v1.types.CreatePrivateNetworkRequest(zone: 'Optional[Zone]', name: 'Optional[str]', project_id: 'Optional[str]', tags: 'Optional[List[str]]', subnets: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Name for the Private Network.

project_id: Optional[str]

Scaleway Project in which to create the Private Network.

subnets: Optional[List[str]]

Private Network subnets CIDR.

tags: Optional[List[str]]

Tags for the Private Network.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.vpc.v1.types.DeletePrivateNetworkRequest(private_network_id: 'str', zone: 'Optional[Zone]')

Bases: object

private_network_id: str

Private Network ID.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.vpc.v1.types.GetPrivateNetworkRequest(private_network_id: 'str', zone: 'Optional[Zone]')

Bases: object

private_network_id: str

Private Network ID.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.vpc.v1.types.ListPrivateNetworksRequest(zone: 'Optional[Zone]', 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]]', include_regional: 'Optional[bool]')

Bases: object

include_regional: Optional[bool]

Defines whether to include regional Private Networks in the response.

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.

tags: Optional[List[str]]

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

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.vpc.v1.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.vpc.v1.types.ListPrivateNetworksResponse(private_networks: 'List[PrivateNetwork]', total_count: 'int')

Bases: object

private_networks: List[PrivateNetwork]
total_count: int
class scaleway.vpc.v1.types.PrivateNetwork(id: 'str', name: 'str', organization_id: 'str', project_id: 'str', zone: 'Zone', tags: 'List[str]', subnets: 'List[str]', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Date the Private Network was created.

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.

subnets: List[str]

Private Network subnets CIDR.

tags: List[str]

Tags of the Private Network.

updated_at: Optional[datetime]

Date the Private Network was last modified.

zone: str

Availability Zone in which the Private Network is available.

class scaleway.vpc.v1.types.UpdatePrivateNetworkRequest(private_network_id: 'str', zone: 'Optional[Zone]', name: 'Optional[str]', tags: 'Optional[List[str]]', subnets: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Name of the private network.

private_network_id: str

Private Network ID.

subnets: Optional[List[str]]

Private Network subnets CIDR (deprecated).

tags: Optional[List[str]]

Tags for the Private Network.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

Module contents

class scaleway.vpc.v1.CreatePrivateNetworkRequest(zone: 'Optional[Zone]', name: 'Optional[str]', project_id: 'Optional[str]', tags: 'Optional[List[str]]', subnets: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Name for the Private Network.

project_id: Optional[str]

Scaleway Project in which to create the Private Network.

subnets: Optional[List[str]]

Private Network subnets CIDR.

tags: Optional[List[str]]

Tags for the Private Network.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.vpc.v1.DeletePrivateNetworkRequest(private_network_id: 'str', zone: 'Optional[Zone]')

Bases: object

private_network_id: str

Private Network ID.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.vpc.v1.GetPrivateNetworkRequest(private_network_id: 'str', zone: 'Optional[Zone]')

Bases: object

private_network_id: str

Private Network ID.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.vpc.v1.ListPrivateNetworksRequest(zone: 'Optional[Zone]', 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]]', include_regional: 'Optional[bool]')

Bases: object

include_regional: Optional[bool]

Defines whether to include regional Private Networks in the response.

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.

tags: Optional[List[str]]

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

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.vpc.v1.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.vpc.v1.ListPrivateNetworksResponse(private_networks: 'List[PrivateNetwork]', total_count: 'int')

Bases: object

private_networks: List[PrivateNetwork]
total_count: int
class scaleway.vpc.v1.PrivateNetwork(id: 'str', name: 'str', organization_id: 'str', project_id: 'str', zone: 'Zone', tags: 'List[str]', subnets: 'List[str]', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Date the Private Network was created.

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.

subnets: List[str]

Private Network subnets CIDR.

tags: List[str]

Tags of the Private Network.

updated_at: Optional[datetime]

Date the Private Network was last modified.

zone: str

Availability Zone in which the Private Network is available.

class scaleway.vpc.v1.UpdatePrivateNetworkRequest(private_network_id: 'str', zone: 'Optional[Zone]', name: 'Optional[str]', tags: 'Optional[List[str]]', subnets: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Name of the private network.

private_network_id: str

Private Network ID.

subnets: Optional[List[str]]

Private Network subnets CIDR (deprecated).

tags: Optional[List[str]]

Tags for the Private Network.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.vpc.v1.VpcV1API(client: Client, *, bypass_validation: bool = False)

Bases: API

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

create_private_network(*, zone: Optional[str] = None, name: Optional[str] = None, project_id: Optional[str] = None, tags: Optional[List[str]] = None, subnets: Optional[List[str]] = None) PrivateNetwork

Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources in the same Availability Zone. :param zone: Zone to target. If none is passed will use default zone 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. :return: PrivateNetwork

Usage:

result = api.create_private_network()
delete_private_network(*, private_network_id: str, zone: 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 zone: Zone to target. If none is passed will use default zone from the config.

Usage:

result = api.delete_private_network(
    private_network_id="example",
)
get_private_network(*, private_network_id: str, zone: 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 zone: Zone to target. If none is passed will use default zone from the config. :return: PrivateNetwork

Usage:

result = api.get_private_network(
    private_network_id="example",
)
list_private_networks(*, zone: 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, include_regional: Optional[bool] = None) ListPrivateNetworksResponse

List Private Networks. List existing Private Networks in a specified Availability Zone. 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 zone: Zone to target. If none is passed will use default zone 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 include_regional: Defines whether to include regional Private Networks in the response. :return: ListPrivateNetworksResponse

Usage:

result = api.list_private_networks()
list_private_networks_all(*, zone: 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, include_regional: Optional[bool] = None) List[PrivateNetwork]

List Private Networks. List existing Private Networks in a specified Availability Zone. 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 zone: Zone to target. If none is passed will use default zone 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 include_regional: Defines whether to include regional Private Networks in the response. :return: List[PrivateNetwork]

Usage:

result = api.list_private_networks_all()
update_private_network(*, private_network_id: str, zone: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None, subnets: 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 zone: Zone to target. If none is passed will use default zone from the config. :param name: Name of the private network. :param tags: Tags for the Private Network. :param subnets: Private Network subnets CIDR (deprecated). :return: PrivateNetwork

Usage:

result = api.update_private_network(
    private_network_id="example",
)