本文整理汇总了Python中appcontroller_client.AppControllerClient.set_property方法的典型用法代码示例。如果您正苦于以下问题:Python AppControllerClient.set_property方法的具体用法?Python AppControllerClient.set_property怎么用?Python AppControllerClient.set_property使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类appcontroller_client.AppControllerClient
的用法示例。
在下文中一共展示了AppControllerClient.set_property方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_property
# 需要导入模块: from appcontroller_client import AppControllerClient [as 别名]
# 或者: from appcontroller_client.AppControllerClient import set_property [as 别名]
def set_property(cls, options):
"""Instructs AppScale to replace the value it uses for a particular
AppController instance variable (property) with a new value.
Args:
options: A Namespace that has fields for each parameter that can be passed
in via the command-line interface.
"""
shadow_host = LocalState.get_host_with_role(options.keyname, "shadow")
acc = AppControllerClient(shadow_host, LocalState.get_secret_key(options.keyname))
result = acc.set_property(options.property_name, options.property_value)
if result == "OK":
AppScaleLogger.success("Successfully updated the given property.")
else:
raise AppControllerException("Unable to update the given property " + "because: {0}".format(result))