本文整理汇总了Python中marvin.lib.base.NetworkOffering.update方法的典型用法代码示例。如果您正苦于以下问题:Python NetworkOffering.update方法的具体用法?Python NetworkOffering.update怎么用?Python NetworkOffering.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marvin.lib.base.NetworkOffering
的用法示例。
在下文中一共展示了NetworkOffering.update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createEnabledNetworkOffering
# 需要导入模块: from marvin.lib.base import NetworkOffering [as 别名]
# 或者: from marvin.lib.base.NetworkOffering import update [as 别名]
def createEnabledNetworkOffering(apiclient, networkServices):
"""Create and enable network offering according to the type
@output: List, containing [ Result,Network Offering,Reason ]
Ist Argument('Result') : FAIL : If exception or assertion error occurs
PASS : If network offering
is created and enabled successfully
IInd Argument(Net Off) : Enabled network offering
In case of exception or
assertion error, it will be None
IIIrd Argument(Reason) : Reason for failure,
default to None
"""
try:
resultSet = [FAIL, None, None]
# Create network offering
network_offering = NetworkOffering.create(apiclient, networkServices, conservemode=False)
# Update network offering state from disabled to enabled.
NetworkOffering.update(network_offering, apiclient, id=network_offering.id,
state="enabled")
except Exception as e:
resultSet[2] = e
return resultSet
return [PASS, network_offering, None]