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