【问题标题】:Service credentials are not populated when service instance is created using cloud foundry rest API使用 Cloud Foundry REST API 创建服务实例时不填充服务凭证
【发布时间】:2016-10-30 05:10:31
【问题描述】:

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

【问题讨论】:

  • 我刚刚通过从 bluemix UI 创建 MessageHub 实例进行检查,并且服务凭证是自动创建的,那么如何从 API 获得相同的行为?
  • 当我使用cf create-service messagehub standard messagehub 实例化服务实例时,不会创建凭据。

标签: python ibm-cloud cloud-foundry message-hub


【解决方案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

【讨论】:

    猜你喜欢
    • 2021-12-16
    • 1970-01-01
    • 2018-07-11
    • 1970-01-01
    • 2019-10-19
    • 1970-01-01
    • 2018-12-25
    • 2016-10-05
    • 1970-01-01
    相关资源
    最近更新 更多