ByCloud Docs
GuidesCLIAPISDK

Python SDK

Networking

Networks, subnets, routers, floating IPs, and security groups

36 methods

GET

list_floating_ips()

List floating IPs

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

status

string

- Filter by status

tags

string

- Filter by tags (comma-separated)

floating_network_id

string

- Filter by floating network ID

floating_ip_address

string

- Filter by floating IP address

port_id

string

- Filter by associated port ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.list_floating_ips()
print(result)
POST

create_floating_ip()

Create floating IP

Parameters

floating_network_id

string

required

- External network to allocate from

description

string

floating_ip_address

string

- Specific IP to allocate (if available)

subnet_id

string

- Subnet to allocate from

port_id

string

- Port to associate with

fixed_ip_address

string

- Fixed IP to associate with (if port has multiple IPs)

dns_domain

string

dns_name

string

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.create_floating_ip(floating_network_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
GET

get_floating_ip()

Get floating IP

Parameters

floating_ip_id

string

required

- Floating IP ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.get_floating_ip(floating_ip_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
PATCH

update_floating_ip()

Update floating IP

Parameters

floating_ip_id

string

required

- Floating IP ID

description

string

port_id

string

- Port to associate (null to disassociate)

fixed_ip_address

string

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.update_floating_ip(floating_ip_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
DELETE

delete_floating_ip()

Delete floating IP

Parameters

floating_ip_id

string

required

- Floating IP ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.delete_floating_ip(floating_ip_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
GET

list_networks()

List networks

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

status

string

- Filter by status

tags

string

- Filter by tags (comma-separated)

shared

boolean

- Filter by shared status

external

boolean

- Filter by external network status

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.list_networks()
print(result)
POST

create_network()

Create network

Parameters

name

string

required
description

string

mtu

integer

port_security_enabled

boolean

dns_domain

string

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.create_network(name="private-network")
print(result)
GET

get_network()

Get network

Parameters

network_id

string

required

- Network ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.get_network(network_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
PATCH

update_network()

Update network

Parameters

network_id

string

required

- Network ID

name

string

description

string

mtu

integer

port_security_enabled

boolean

dns_domain

string

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.update_network(network_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
DELETE

delete_network()

Delete network

Parameters

network_id

string

required

- Network ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.delete_network(network_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
GET

list_ports()

List ports

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

status

string

- Filter by status

tags

string

- Filter by tags (comma-separated)

network_id

string

- Filter by network ID

device_id

string

- Filter by device ID (instance, router, etc.)

device_owner

string

- Filter by device owner

mac_address

string

- Filter by MAC address

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.list_ports()
print(result)
POST

create_port()

Create port

Parameters

name

string

description

string

network_id

string

required
mac_address

string

- MAC address (auto-generated if omitted)

fixed_ips

array

security_groups

array

port_security_enabled

boolean

allowed_address_pairs

array

dns_name

string

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.create_port(network_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
GET

get_port()

Get port

Parameters

port_id

string

required

- Port ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.get_port(port_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
PATCH

update_port()

Update port

Parameters

port_id

string

required

- Port ID

name

string

description

string

fixed_ips

array

security_groups

array

port_security_enabled

boolean

allowed_address_pairs

array

dns_name

string

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.update_port(port_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
DELETE

delete_port()

Delete port

Parameters

port_id

string

required

- Port ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.delete_port(port_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
GET

list_routers()

List routers

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

status

string

- Filter by status

tags

string

- Filter by tags (comma-separated)

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.list_routers()
print(result)
POST

create_router()

Create router

Parameters

name

string

required
description

string

external_gateway_info

object

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.create_router(name="main-router")
print(result)
GET

get_router()

Get router

Parameters

router_id

string

required

- Router ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.get_router(router_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
PATCH

update_router()

Update router

Parameters

router_id

string

required

- Router ID

name

string

description

string

external_gateway_info

object

routes

array

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.update_router(router_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
DELETE

delete_router()

Delete router

Parameters

router_id

string

required

- Router ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.delete_router(router_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
POST

add_router_interface()

Add router interface

Parameters

router_id

string

required

- Router ID

subnet_id

string

- Subnet to connect (mutually exclusive with port_id)

port_id

string

- Port to connect (mutually exclusive with subnet_id)

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.add_router_interface(router_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
POST

remove_router_interface()

Remove router interface

Parameters

router_id

string

required

- Router ID

subnet_id

string

port_id

string

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.remove_router_interface(router_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
GET

list_security_group_rules()

List security group rules

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

security_group_id

string

- Filter by security group ID

direction

string

- Filter by direction

protocol

string

- Filter by protocol

ethertype

string

- Filter by ethertype

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.list_security_group_rules()
print(result)
POST

create_security_group_rule()

Create security group rule

Parameters

security_group_id

string

required
direction

string

required
ethertype

string

protocol

string

port_range_min

integer

port_range_max

integer

remote_ip_prefix

string

remote_group_id

string

description

string

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.create_security_group_rule(security_group_id="550e8400-e29b-41d4-a716-446655440000", direction="ingress")
print(result)
GET

get_security_group_rule()

Get security group rule

Parameters

security_group_rule_id

string

required

- Security Group Rule ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.get_security_group_rule(security_group_rule_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
DELETE

delete_security_group_rule()

Delete security group rule

Parameters

security_group_rule_id

string

required

- Security Group Rule ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.delete_security_group_rule(security_group_rule_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
GET

list_security_groups()

List security groups

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

tags

string

- Filter by tags (comma-separated)

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.list_security_groups()
print(result)
POST

create_security_group()

Create security group

Parameters

name

string

required
description

string

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.create_security_group(name="web-servers")
print(result)
GET

get_security_group()

Get security group

Parameters

security_group_id

string

required

- Security Group ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.get_security_group(security_group_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
PATCH

update_security_group()

Update security group

Parameters

security_group_id

string

required

- Security Group ID

name

string

description

string

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.update_security_group(security_group_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
DELETE

delete_security_group()

Delete security group

Parameters

security_group_id

string

required

- Security Group ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.delete_security_group(security_group_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
GET

list_subnets()

List subnets

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

tags

string

- Filter by tags (comma-separated)

network_id

string

- Filter by network ID

ip_version

integer

- Filter by IP version

cidr

string

- Filter by CIDR

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.list_subnets()
print(result)
POST

create_subnet()

Create subnet

Parameters

name

string

description

string

network_id

string

required
ip_version

integer

required
cidr

string

required
gateway_ip

string

- Gateway IP (auto-assigned if omitted, null to disable)

dns_nameservers

array

allocation_pools

array

host_routes

array

enable_dhcp

boolean

ipv6_ra_mode

string

ipv6_address_mode

string

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.create_subnet(network_id="550e8400-e29b-41d4-a716-446655440000", ip_version=4, cidr="192.168.1.0/24")
print(result)
GET

get_subnet()

Get subnet

Parameters

subnet_id

string

required

- Subnet ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.get_subnet(subnet_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
PATCH

update_subnet()

Update subnet

Parameters

subnet_id

string

required

- Subnet ID

name

string

description

string

gateway_ip

string

dns_nameservers

array

allocation_pools

array

host_routes

array

enable_dhcp

boolean

tags

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.update_subnet(subnet_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
DELETE

delete_subnet()

Delete subnet

Parameters

subnet_id

string

required

- Subnet ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.networking.delete_subnet(subnet_id="550e8400-e29b-41d4-a716-446655440000")
print(result)