本文整理汇总了Python中networkapi.ambiente.models.EnvironmentVip.get方法的典型用法代码示例。如果您正苦于以下问题:Python EnvironmentVip.get方法的具体用法?Python EnvironmentVip.get怎么用?Python EnvironmentVip.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类networkapi.ambiente.models.EnvironmentVip
的用法示例。
在下文中一共展示了EnvironmentVip.get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle_get
# 需要导入模块: from networkapi.ambiente.models import EnvironmentVip [as 别名]
# 或者: from networkapi.ambiente.models.EnvironmentVip import get [as 别名]
def handle_get(self, request, user, *args, **kwargs):
"""Handles GET requests to find all finalitys of environment VIP.
URLs: /vip/get/finality
"""
self.log.info("Find all finality distinct of environment_vip")
try:
# Commons Validations
# User permission
if not has_perm(user, AdminPermission.VIPS_REQUEST, AdminPermission.READ_OPERATION):
self.log.error(u"User does not have permission to perform the operation.")
return self.not_authorized()
evip = EnvironmentVip()
# Business Validations
evips = evip.list_all_finalitys()
finality_map = dict()
finality_list = []
for evip in evips:
finality_map["finality"] = evip.get("finalidade_txt")
finality_list.append(finality_map)
finality_map = dict()
return self.response(dumps_networkapi({"finalidade": finality_list}))
except InvalidValueError, e:
self.log.error(u"Parameter %s is invalid. Value: %s.", e.param, e.value)
return self.response_error(269, e.param, e.value)