openstack中Nova组件Networks的所有python API 汇总

感谢朋友支持本博客,欢迎共同探讨交流,由于能力和时间有限,错误之处在所难免,欢迎指正!
如果转载,请保留作者信息。
博客地址:http://blog.csdn.net/qq_21398167

原博文地址:http://blog.csdn.net/qq_21398167/article/details/46620261

Networks

Network interface.

class novaclient.v2.networks. Network ( manager, info, loaded=False )

Bases: novaclient.openstack.common.apiclient.base.Resource

A network.

Populate and bind to a manager.

Parameters:
  • manager – BaseManager object
  • info – dictionary representing resource attributes
  • loaded – prevent lazy-loading if set to True
HUMAN_ID = True

NAME_ATTR = 'label'

delete ( )

class novaclient.v2.networks. NetworkManager ( api )

Bases: novaclient.base.ManagerWithFind

Manage Network resources.

add ( network=None )

Associates the current project with a network. Network can be chosenautomatically or provided explicitly.

Parameters:network – The ID of the Network to associate (optional).
associate_host ( network, host )

Associate a specific network with a host.

Parameters:
  • network – The ID of the Network.
  • host – The name of the host to associate the network with
associate_project ( network )

Associate a specific network with a project.

The project is defined by the project authenticated against

Parameters:network – The ID of the Network.
create ( **kwargs )

Create (allocate) a network. The following parameters areoptional except for label; cidr or cidr_v6 must be specified, too.

Parameters:
  • label – str
  • bridge – str
  • bridge_interface – str
  • cidr – str
  • cidr_v6 – str
  • dns1 – str
  • dns2 – str
  • fixed_cidr – str
  • gateway – str
  • gateway_v6 – str
  • multi_host – str
  • priority – str
  • project_id – str
  • vlan – int
  • vlan_start – int
  • vpn_start – int
  • mtu – int
  • enable_dhcp – int
  • dhcp_server – str
  • share_address – int
  • allowed_start – str
  • allowed_end – str
Return type:

object of Network

delete ( network )

Delete a specific network.

Parameters:network – The ID of the Network to delete.
disassociate ( network, disassociate_host=True, disassociate_project=True )

Disassociate a specific network from project and/or host.

Parameters:
  • network – The ID of the Network.
  • disassociate_host – Whether to disassociate the host
  • disassociate_project – Whether to disassociate the project
get ( network )

Get a specific network.

Parameters:network – The ID of the Network to get.
Return type:Network
list ( )

Get a list of all networks.

Return type:list of Network.
resource_class

alias of Network

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值