本文整理汇总了Python中mistral.utils.openstack.keystone.get_endpoint_for_project函数的典型用法代码示例。如果您正苦于以下问题:Python get_endpoint_for_project函数的具体用法?Python get_endpoint_for_project怎么用?Python get_endpoint_for_project使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_endpoint_for_project函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _get_client
def _get_client(self):
ctx = context.ctx()
LOG.debug("Cinder action security context: %s" % ctx)
cinder_endpoint = keystone_utils.get_endpoint_for_project(
service_type='volume'
)
cinder_url = keystone_utils.format_url(
cinder_endpoint.url,
{'tenant_id': ctx.project_id}
)
client = self._client_class(
ctx.user_name,
ctx.auth_token,
project_id=ctx.project_id,
auth_url=cinder_url,
region_name=cinder_endpoint.region
)
client.client.auth_token = ctx.auth_token
client.client.management_url = cinder_url
return client
开发者ID:kantorv,项目名称:mistral,代码行数:26,代码来源:actions.py
示例2: _get_client
def _get_client(self):
ctx = context.ctx()
LOG.debug("Trove action security context: %s" % ctx)
trove_endpoint = keystone_utils.get_endpoint_for_project(
service_type='database'
)
trove_url = keystone_utils.format_url(
trove_endpoint.url,
{'tenant_id': ctx.project_id}
)
client = self._get_client_class()(
ctx.user_name,
ctx.auth_token,
project_id=ctx.project_id,
auth_url=trove_url,
region_name=trove_endpoint.region
)
client.client.auth_token = ctx.auth_token
client.client.management_url = trove_url
return client
开发者ID:PrinceKatiyar,项目名称:mistral,代码行数:26,代码来源:actions.py
示例3: _get_client
def _get_client(self):
ctx = context.ctx()
LOG.debug("Mistral action security context: %s" % ctx)
# Check for trust scope token. This may occur if the action is
# called from a workflow triggered by a Mistral cron trigger.
if ctx.is_trust_scoped:
auth_url = None
mistral_endpoint = keystone_utils.get_endpoint_for_project(
'mistral'
)
mistral_url = mistral_endpoint.url
else:
keystone_endpoint = keystone_utils.get_keystone_endpoint_v2()
auth_url = keystone_endpoint.url
mistral_url = None
return self._client_class(
mistral_url=mistral_url,
auth_token=ctx.auth_token,
project_id=ctx.project_id,
user_id=ctx.user_id,
auth_url=auth_url
)
开发者ID:cibingeorge,项目名称:mistral,代码行数:25,代码来源:actions.py
示例4: _get_workflow_client
def _get_workflow_client(self):
ctx = context.ctx()
mistral_endpoint = keystone_utils.get_endpoint_for_project('mistral')
mc = mistral_client.client(auth_token=ctx.auth_token,
mistral_url=mistral_endpoint.url)
return mc
开发者ID:rbrady,项目名称:tripleo-common,代码行数:8,代码来源:base.py
示例5: _get_object_client
def _get_object_client(self):
ctx = context.ctx()
obj_ep = keystone_utils.get_endpoint_for_project('swift')
kwargs = {
'preauthurl': obj_ep.url % {'tenant_id': ctx.project_id},
'preauthtoken': ctx.auth_token
}
return swift_client.Connection(**kwargs)
开发者ID:rbrady,项目名称:tripleo-common,代码行数:10,代码来源:base.py
示例6: _create_client
def _create_client(self, context):
LOG.debug("Magnum action security context: %s", context)
keystone_endpoint = keystone_utils.get_keystone_endpoint()
auth_url = keystone_endpoint.url
magnum_url = keystone_utils.get_endpoint_for_project('magnum').url
return self._get_client_class()(
magnum_url=magnum_url,
auth_token=context.auth_token,
project_id=context.project_id,
auth_url=auth_url,
insecure=context.insecure
)
开发者ID:openstack,项目名称:mistral,代码行数:15,代码来源:actions.py
示例7: _get_orchestration_client
def _get_orchestration_client(self):
ctx = context.ctx()
heat_endpoint = keystone_utils.get_endpoint_for_project('heat')
endpoint_url = keystone_utils.format_url(
heat_endpoint.url,
{'tenant_id': ctx.project_id}
)
return heatclient.Client(
endpoint_url,
region_name=heat_endpoint.region,
token=ctx.auth_token,
username=ctx.user_name
)
开发者ID:rbrady,项目名称:tripleo-common,代码行数:15,代码来源:base.py
示例8: _get_client
def _get_client(self):
ctx = context.ctx()
LOG.debug("Murano action security context: %s" % ctx)
keystone_endpoint = keystone_utils.get_keystone_endpoint_v2()
murano_endpoint = keystone_utils.get_endpoint_for_project('murano')
return self._client_class(
endpoint=murano_endpoint.url,
token=ctx.auth_token,
tenant=ctx.project_id,
region_name=murano_endpoint.region,
auth_url=keystone_endpoint.url
)
开发者ID:xavierhardy,项目名称:mistral,代码行数:15,代码来源:actions.py
注:本文中的mistral.utils.openstack.keystone.get_endpoint_for_project函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论