Help Center > > Developer Guide> Mapping Between API and SDK> Python> VPC

VPC

Updated at: Oct 09, 2019 GMT+08:00

The SDK interfaces based on the VPC v1 API are as follows. Invocation example: conn.vpc.create_network().

Interface

Method

API

vpc

vpcs(self, **query)

GET /v1/{project_id}/vpcs

get_vpc(self, vpc)

GET /v1/{project_id}/vpcs/{vpc_id}

create_vpc(self, **attrs)

POST /v1/{project_id}/vpcs

update_vpc(self, vpc, **attrs)

PUT /v1/{project_id}/vpcs/{vpc_id}

delete_vpc(self, vpc, ignore_missing=True)

DELETE /v1/{project_id}/vpcs/{vpc_id}

find_vpc(self, name_or_id, ignore_missing=True)

  • GET /v1/{project_id}/vpcs/{vpc_id}
  • GET /v1/{project_id}/vpcs

subnet

subnets(self, **query)

GET /v1/{project_id}/subnets

get_subnet(self, subnet)

GET /v1/{project_id}/subnets/{subnet_id}

create_subnet(self, **attrs)

POST /v1/{project_id}/subnets

update_subnet(self, subnet, vpc_id, **attrs)

PUT /v1/{project_id}/vpcs/{vpc_id}/subnets/{subnet_id}

delete_subnet(self, subnet, vpc_id, ignore_missing=True)

DELETE /v1/{project_id}/vpcs/{vpc_id}/subnets/{subnet_id}

find_subnet(self, name_or_id, ignore_missing=True)

  • GET /v1/{project_id}/subnets/{subnet_id}
  • GET /v1/{project_id}/subnets

public_ip

public_ips(self, **query)

GET /v1/{project_id}/publicips

get_public_ip(self, public_ip)

GET /v1/{project_id}/publicips/{publicip_id}

create_public_ip(self, **attrs)

POST /v1/{project_id}/publicips

update_public_ip(self, public_ip, **attrs)

PUT /v1/{project_id}/publicips/{publicip_id}

delete_public_ip(self, public_ip, ignore_missing=True)

DELETE /v1/{project_id}/publicips/{publicip_id}

find_public_ip(self, name_or_id, ignore_missing=True)

  • GET /v1/{project_id}/publicips/{publicip_id}
  • GET /v1/{project_id}/publicips

private_ip

private_ips(self, subnet, **query)

GET /v1/{project_id}/subnets/{subnet_id}/privateips

get_private_ip(self, private_ip)

GET /v1/{project_id}/privateips/{privateip_id}

create_private_ip(self, **attrs)

POST /v1/{project_id}/privateips

create_private_ips(self, *private_ips)

POST /v1/{project_id}/privateips

delete_private_ip(self, private_ip, ignore_missing=True)

DELETE /v1/{project_id}/privateips/{privateip_id}

find_private_ip(self, name_or_id, subnet_id, ignore_missing=True)

  • GET /v1/{project_id}/privateips/{privateip_id}
  • GET /v1/{project_id}/subnets/{subnet_id}/privateips

port

ports(self, **query)

GET /v1/{project_id}/ports

get_port(self, port)

GET /v1/{project_id}/ports/{port_id}

create_port(self, **attrs)

POST /v1/{project_id}/ports

update_port(self, port, **attrs)

PUT /v1/{project_id}/ports/{port_id}

delete_port(self, port, ignore_missing=True)

DELETE /v1/{project_id}/ports/{port_id}

find_port(self, name_or_id, ignore_missing=True)

  • GET /v1/{project_id}/ports/{port_id}
  • GET /v1/{project_id}/ports

bandwidth

bandwidths(self, **query)

GET /v1/{project_id}/bandwidths

get_bandwidth(self, bandwidth)

GET /v1/{project_id}/bandwidths/{bandwidth_id}

update_bandwidth(self, bandwidth, **attrs)

PUT /v1/{project_id}/bandwidths/{bandwidth_id}

find_bandwidth(self, name_or_id, ignore_missing=True)

  • GET /v1/{project_id}/bandwidths/{bandwidth_id
  • GET /v1/{project_id}/bandwidths

security_group

security_groups(self, **query)

GET /v1/{project_id}/security-groups

create_security_group(self, **attrs)

POST /v1/{project_id}/security-groups

delete_security_group(self, security_group, ignore_missing=True)

DELETE /v1/{project_id}/security-groups/{security_group_id}

get_security_group(self, security_group)

GET /v1/{project_id}/security-groups/{security_group_id}

find_security_group(self, name_or_id, ignore_missing=True)

  • GET /v1/{project_id}/security-groups/{security_group_id}
  • GET /v1/{project_id}/security-groups

security_group_rule

create_security_group_rule(self, **attrs)

POST /v1/{project_id}/security-group-rules

delete_security_group_rule(self, security_group_rule, ignore_missing=True)

DELETE /v1/{project_id}/security-group-rules/{rules_security_groups_id}

get_security_group_rule(self, security_group_rule)

GET /v1/{project_id}/security-group-rules/{rules_security_groups_id}

security_group_rules(self, **query)

GET /v1/{project_id}/security-group-rules

find_security_group_rule(self, name_or_id, ignore_missing=True)

  • GET /v1/{project_id}/security-group-rules/{rules_security_groups_id}
  • GET /v1/{project_id}/security-group-rules

quota

quotas(self, **query)

GET /v1/{project_id}/quotas

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

delete_ip(self, floating_ip, ignore_missing=True)

DELETE /v2.0/floatingips/{floatingip_id}

find_available_ip(self)

GET /v2.0/floatingips

find_ip(self, name_or_id, ignore_missing=True)

GET /v2.0/floatingips

get_ip(self, floating_ip)

GET /v2.0/floatingips/{floatingip_id}

ips(self, **query)

GET /v2.0/floatingips

update_ip(self, floating_ip, **attrs)

PUT /v2.0/floatingips/{floatingip_id}

Network Operations

create_network(self, **attrs)

POST /v2.0/networks

delete_network(self, network, ignore_missing=True)

DELETE /v2.0/networks/{network_id}

find_network(self, name_or_id, ignore_missing=True)

GET /v2.0/networks

get_network(self, network)

GET /v2.0/networks/{network_id}

networks(self, **query)

GET /v2.0/networks

update_network(self, network, **attrs)

PUT /v2.0/networks/{network_id}

Port Operations

create_port(self, **attrs)

POST /v2.0/ports

delete_port(self, port, ignore_missing=True)

DELETE /v2.0/ports/{port_id}

find_port(self, name_or_id, ignore_missing=True)

GET /v2.0/ports

get_port(self, port)

GET /v2.0/ports/{port_id}

ports(self, **query)

GET /v2.0/ports

update_port(self, port, **attrs)

PUT /v2.0/ports/{port_id}

Router 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}

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, port_id=None)

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

Security Group Operations

create_security_group(self, **attrs)

POST /v2.0/security-groups

delete_security_group(self, security_group, ignore_missing=True)

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

find_security_group(self, name_or_id, ignore_missing=True)

GET /v2.0/security-groups

get_security_group(self, security_group)

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

security_groups(self, **query)

GET /v2.0/security-groups

update_security_group(self, security_group, **attrs)

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

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

POST /v2.0/security-group-rules

security_group_allow_ping(self, sgid)

POST /v2.0/security-group-rules

create_security_group_rule(self, **attrs)

POST /v2.0/security-group-rules

delete_security_group_rule(self, security_group_rule, ignore_missing=True)

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

find_security_group_rule(self, name_or_id, ignore_missing=True)

GET /v2.0/security-group-rules

get_security_group_rule(self, security_group_rule)

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

security_group_rules(self, **query)

GET /v2.0/security-group-rules

Subnet Operations

create_subnet(self, **attrs)

POST /v2.0/subnets

delete_subnet(self, subnet, ignore_missing=True)

DELETE /v2.0/subnets/{subnet_id}

find_subnet(self, name_or_id, ignore_missing=True)

GET /v2.0/subnets

get_subnet(self, subnet)

GET /v2.0/subnets/{subnet_id}

subnets(self, **query)

GET /v2.0/subnets

get_subnet_ports(self, subnet_id)

GET /v2.0/ports

update_subnet(self, subnet, **attrs)

PUT /v2.0/subnets/{subnet_id}

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel