bind-service - Cloud Foundry CLI Reference Guide


名称

bind-service - 将服务实例绑定到应用程序

用法

cf bind-service APP_NAME SERVICE_INSTANCE [-c PARAMETERS_AS_JSON] [--binding-name BINDING_NAME] Optionally provide service-specific configuration parameters in a valid JSON object in-line: cf bind-service APP_NAME SERVICE_INSTANCE -c '{"name":"value","name":"value"}' Optionally provide a file containing service-specific configuration parameters in a valid JSON object. The path to the parameters file can be an absolute or relative path to a file. cf bind-service APP_NAME SERVICE_INSTANCE -c PATH_TO_FILE Example of valid JSON object: { "permissions": "read-only" } Optionally provide a binding name for the association between an app and a service instance: cf bind-service APP_NAME SERVICE_INSTANCE --binding-name BINDING_NAME

EXAMPLES

Linux/Mac: cf bind-service myapp mydb -c '{"permissions":"read-only"}' Windows Command Line: cf bind-service myapp mydb -c "{\"permissions\":\"read-only\"}" Windows PowerShell: cf bind-service myapp mydb -c '{\"permissions\":\"read-only\"}' cf bind-service myapp mydb -c ~/workspace/tmp/instance_config.json --binding-name BINDING_NAME

别名

bs

选项

--binding-name

用于向应用程序进程公开服务实例的名称(缺省值: 服务实例名称)

-c

包含特定于服务的配置参数的有效 JSON 对象,以直接插入方式提供或在文件中提供。有关受支持配置参数的列表,请参阅特定服务产品的文档。

另请参阅

services