本文整理汇总了Python中qubell.api.provider.router.ROUTER.post_organization_environment方法的典型用法代码示例。如果您正苦于以下问题:Python ROUTER.post_organization_environment方法的具体用法?Python ROUTER.post_organization_environment怎么用?Python ROUTER.post_organization_environment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qubell.api.provider.router.ROUTER
的用法示例。
在下文中一共展示了ROUTER.post_organization_environment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: new
# 需要导入模块: from qubell.api.provider.router import ROUTER [as 别名]
# 或者: from qubell.api.provider.router.ROUTER import post_organization_environment [as 别名]
def new(organization, name, zone=None, default=False):
log.info("Creating environment: %s" % name)
if not zone:
zone = organization.zone.zoneId
data = {'isDefault': default,
'name': name,
'backend': zone,
'organizationId': organization.organizationId}
resp = router.post_organization_environment(org_id=organization.organizationId, data=json.dumps(data)).json()
return Environment(organization, id=resp['id'])
示例2: new
# 需要导入模块: from qubell.api.provider.router import ROUTER [as 别名]
# 或者: from qubell.api.provider.router.ROUTER import post_organization_environment [as 别名]
def new(organization, name, zone_id=None, default=False):
log.info("Creating environment: %s" % name)
if not zone_id:
zone_id = organization.zone.zoneId
data = {'isDefault': default,
'name': name,
'backend': zone_id,
'organizationId': organization.organizationId}
log.debug(data)
resp = router.post_organization_environment(org_id=organization.organizationId, data=json.dumps(data)).json()
env = Environment(organization, id=resp['id'])
log.info("Environment created: %s (%s)" % (name,env.environmentId))
return env