使用 cloud foundry rest 创建服务实例时未填充服务凭据 API
Service credentials are not populated when service instance is created using cloud foundry rest API
我正在使用 python Cloud Foundry 客户端创建 Message Hub 服务实例:
$ pip install --user --quiet protobuf
$ pip install --user --quiet cloudfoundry-client
from cloudfoundry_client.client import CloudFoundryClient
target_endpoint = 'https://api.ng.bluemix.net'
client = CloudFoundryClient(target_endpoint, skip_verification=False)
client.init_with_user_credentials(
ibm_id,
ibm_id_password
)
mh_service = client.service_instances.create(
space_guid,
'my_mh2',
mh_plan_id
)
服务已创建,但当我使用管理控制台查看凭据时,它们是空的:
我在 python 客户端的集成测试代码中看到可以创建参数和标签:
client.service_instances.create(
'space_guid',
'name',
'plan_id',
parameters=dict(the_service_broker="wants this object"),
tags=['example']
)
因此,我猜我需要传递一些额外的东西来告诉 bluemix 为我创建一些默认凭证?
我认为您需要针对该第 3 方 Python 客户端提出另一个 GH 问题,以便 CF 也允许创建服务密钥 https://github.com/antechrestos/cf-python-client/issues/11
使用 cf cli 你会这样做:
cf create-service ${MESSAGE_HUB_SERVICE} ${MESSAGE_HUB_PLAN} ${MESSAGE_HUB_INSTANCE_NAME}
cf create-service-key ${MESSAGE_HUB_INSTANCE_NAME} Credentials-1
我正在使用 python Cloud Foundry 客户端创建 Message Hub 服务实例:
$ pip install --user --quiet protobuf
$ pip install --user --quiet cloudfoundry-client
from cloudfoundry_client.client import CloudFoundryClient
target_endpoint = 'https://api.ng.bluemix.net'
client = CloudFoundryClient(target_endpoint, skip_verification=False)
client.init_with_user_credentials(
ibm_id,
ibm_id_password
)
mh_service = client.service_instances.create(
space_guid,
'my_mh2',
mh_plan_id
)
服务已创建,但当我使用管理控制台查看凭据时,它们是空的:
我在 python 客户端的集成测试代码中看到可以创建参数和标签:
client.service_instances.create(
'space_guid',
'name',
'plan_id',
parameters=dict(the_service_broker="wants this object"),
tags=['example']
)
因此,我猜我需要传递一些额外的东西来告诉 bluemix 为我创建一些默认凭证?
我认为您需要针对该第 3 方 Python 客户端提出另一个 GH 问题,以便 CF 也允许创建服务密钥 https://github.com/antechrestos/cf-python-client/issues/11
使用 cf cli 你会这样做:
cf create-service ${MESSAGE_HUB_SERVICE} ${MESSAGE_HUB_PLAN} ${MESSAGE_HUB_INSTANCE_NAME}
cf create-service-key ${MESSAGE_HUB_INSTANCE_NAME} Credentials-1