文档首页> > 开发指南> API & SDK 对应关系> Python> VPC

VPC

分享
更新时间: 2019/07/09 15:07

基于VPC v1 API的SDK接口如下,调用方式举例: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

链接

基于VPC v2.0 API的SDK接口如下,调用方式举例:conn.vpc.create_publicip_ext()

Interface

Method

API

sharebandwidth

create_sharebandwidth(self, **data)

POST /v2.0/{project_id}/bandwidths

链接

delete_sharebandwidth(self, bandwidth_id, ignore_missing=True)

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

链接

create_batch_sharebandwidth(self, **data)

POST /v2.0/{project_id}/batch-bandwidths

链接

insert_ip_to_bandwidth(self, bandwidth_id, **data)

POST /v2.0/{project_id}/bandwidths/{bandwidth_id}/insert

链接

remove_ip_from_bandwidth(self, bandwidth_id, **data)

POST /v2.0/{project_id}/bandwidths/{bandwidth_id}/remove

链接

Eip Operations

create_publicip_ext(self, **attrs)

POST /v2.0/{project_id}/publicips

链接

Bandwidth Operations

update_bandwidth_ext(self, bandwidth_id, **attrs)

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

链接

基于Neutron v2.0 API的SDK接口如下,调用方式举例: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}

链接

如果您喜欢这篇文档,您还可以:

文档是否有解决您的问题?

提交成功!

非常感谢您的反馈,我们会继续努力做到更好!

反馈提交失败,请稍后再试!

*必选

请至少选择或填写一项反馈信息

字符长度不能超过200

提交反馈 取消

如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨

跳转到云社区