使用 cf 绑定服务自定义配置的 Bluemix 绑定 WIoTP 服务



Cloud Foundry提供了将凭据指定为cf bind-service命令一部分的工具。我正在使用此工具指定自定义凭据,同时将 WIoTP 服务绑定到 Bluemix 中的应用程序。如下所述匿名命令

 cf bind-service demo-app dev-iotf-service -c   '{"apiKey":"a-dummyorg-dummy12345","apiToken":"dummyapikey","base_uri":"https://dummyorg.internetofthings.ibmcloud.com:443/api/v0001","http_host":"dummyorg.internetofthings.ibmcloud.com","iotCredentialsIdentifier":"dummyid","mqtt_host":"dummyorg.messaging.internetofthings.ibmcloud.com","mqtt_s_port":8883,"mqtt_u_port":1883,"org":"dummyorg"}'

我使用cf create-service-key命令生成了服务密钥。

为 -c 标志提供的配置无效。请提供有效的 JSON 对象或包含有效 JSON 对象的文件的路径。

我做错了什么?还是 Bluemix,WIoTP 当前不支持将自定义凭据指定为命令的一部分cf bind-service。我真的不想走 CUP 路线,因为这需要在相当多的应用程序中进行更改,这些应用程序希望 WIoTP 凭据存在于iotf-service对象中。

我可以完全按照您指定的方式调用该命令(除了替换我的应用程序和服务名称)使用 bx 客户端:

bx cf bind-service myapp my-iotf-service -c '{"apiKey":"a-dummyorg-dummy12345","apiToken":"dummyapikey","base_uri":"https://dummyorg.internetofthings.ibmcloud.com:443/api/v0001","http_host":"dummyorg.internetofthings.ibmcloud.com","iotCredentialsIdentifier":"dummyid","mqtt_host":"dummyorg.messaging.internetofthings.ibmcloud.com","mqtt_s_port":8883,"mqtt_u_port":1883,"org":"dummyorg"}'

它有效。 可能你只是一个旧的 cf 客户端。 您应该使用 bx 客户端,如 https://console.bluemix.net/docs/cli/index.html#downloads

但是,IoTP 不支持此功能,因此会忽略通过此方式发送的任何内容。 显而易见的情况是创建有限的 API 密钥或使用您在尝试时已经创建的 API 密钥。 不幸的是,您需要在 https://ibmcloud.ideas.aha.io/?category=6343565373323972470 提交一个想法才能获得考虑。