本文整理匯總了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