0

我正在使用 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 为我创建一些默认凭据?

4

1 回答 1

1

我认为您需要针对 CF 的第 3 方 Python 客户端提出另一个 GH 问题,以允许创建服务密钥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
于 2016-10-29T21:04:30.810 回答