• CLI

sdk
  1. Help Center
  2. CLI
  3. Developer Guide
  4. Mapping Between API and SDK
  5. Python
  6. VPC

VPC

The SDK interfaces based on the Neutron v2.0 API are as follows.

Invocation example: conn.network.create_network ()

Interface

Method

API

Floating IP Operations

create_ip(self, **attrs)

POST /v2.0/floatingips Create floating IP

delete_ip(self, floating_ip, ignore_missing=True)

DELETE /v2.0/floatingips/{floatingip_id} Delete floating IP

find_available_ip(self)

GET /v2.0/floatingips

find_ip(self, name_or_id, ignore_missing=True)

GET /v2.0/floatingips List floating Ips

get_ip(self, floating_ip)

GET /v2.0/floatingips/{floatingip_id} Show floating IP details

ips(self, **query)

GET /v2.0/floatingips

update_ip(self, floating_ip, **attrs)

PUT /v2.0/floatingips/{floatingip_id} Update floating IP

Network Operations

create_network(self, **attrs)

POST /v2.0/networks Create network

delete_network(self, network, ignore_missing=True)

DELETE /v2.0/networks/{network_id} Delete network

find_network(self, name_or_id, ignore_missing=True)

GET /v2.0/networks List networks

get_network(self, network)

GET /v2.0/networks/{network_id} Show network details

networks(self, **query)

GET /v2.0/networks List networks

update_network(self, network, **attrs)

PUT /v2.0/networks/{network_id} Update network

Port Operations

create_port(self, **attrs)

POST /v2.0/ports Create port

delete_port(self, port, ignore_missing=True)

DELETE /v2.0/ports/{port_id} Delete port

find_port(self, name_or_id, ignore_missing=True)

GET /v2.0/ports List ports

get_port(self, port)

GET /v2.0/ports/{port_id} Show port details

ports(self, **query)

GET /v2.0/ports List ports

update_port(self, port, **attrs)

PUT /v2.0/ports/{port_id} Update port

Router OperationsRouter Operations

create_router(self, **attrs)

POST /v2.0/router

delete_router(self, router, ignore_missing=True)

DELETE /v2.0/routers/{router_id}

find_router(self, name_or_id, ignore_missing=True)

GET /v2.0/routers

get_router(self, router)

GET /v2.0/routers/{router_id}

routers(self, **query)

GET /v2.0/routers

update_router(self, router, **attrs)

PUT /v2.0/routers/{router_id} Update router

add_interface_to_router(self, router, subnet_id=None, port_id=None)

PUT /v2.0/routers/{router_id}/add_router_interface

remove_interface_from_router(self, router, subnet_id=None,

PUT /v2.0/routers/{router_id}/remove_router_interface

Security Group Operations

create_security_group(self, **attrs)

POST /v2.0/security-groups Create security group

delete_security_group(self, security_group, ignore_missing=True)

DELETE /v2.0/security-groups/{security_group_id} Delete security group

find_security_group(self, name_or_id, ignore_missing=True)

GET /v2.0/security-groups List security groups

get_security_group(self, security_group)

GET /v2.0/security-groups/{security_group_id} Show security group

security_groups(self, **query)

GET /v2.0/security-groups List security groups

update_security_group(self, security_group, **attrs)

PUT /v2.0/security-groups/{security_group_id} Update security group

security_group_open_port(self, sgid, port, protocol='tcp')

POST /v2.0/security-group-rules Create security group rule

security_group_allow_ping(self, sgid)

POST /v2.0/security-group-rules Create security group rule

create_security_group_rule(self, **attrs)

POST /v2.0/security-group-rules Create security group rule

delete_security_group_rule(self, security_group_rule,

DELETE /v2.0/security-group-rules/{security_group_rule_id} Delete security group rule

find_security_group_rule(self, name_or_id, ignore_missing=True)

GET /v2.0/security-group-rules List security group rules

get_security_group_rule(self, security_group_rule)

GET /v2.0/security-group-rules/{security_group_rule_id} Show security group rule

security_group_rules(self, **query)

GET /v2.0/security-group-rules List security group rules

Subnet Operations

create_subnet(self, **attrs)

POST /v2.0/subnets Create subnet

delete_subnet(self, subnet, ignore_missing=True)

DELETE /v2.0/subnets/{subnet_id} Delete subnet

find_subnet(self, name_or_id, ignore_missing=True)

GET /v2.0/subnets List subnets

get_subnet(self, subnet)

GET /v2.0/subnets/{subnet_id} Show subnet details

subnets(self, **query)

GET /v2.0/subnets List subnets

get_subnet_ports(self, subnet_id)

get /v2.0/ports

update_subnet(self, subnet, **attrs)

PUT /v2.0/subnets/{subnet_id} Update subnet

The SDK interfaces based on the VPC v2.0 API are as follows.

Invocation example: conn.vpc.create_publicip_ext()

Interface

Method

API

  

create_publicip_ext(self, **attrs)

POST /v2.0/{project_id}/publicips

  

update_bandwidth_ext(self, bandwidth_id, **attrs)

PUT /v2.0/{project_id}/bandwidths/{bandwidth_id}