Skip to content

Commit

Permalink
Split create-service usage for easier translation
Browse files Browse the repository at this point in the history
[#61861194]
  • Loading branch information
rainmaker authored and Greg Cobb and Raina Masand committed Jun 10, 2015
1 parent 8d48196 commit 38c010d
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions cf/commands/service/create_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,43 @@ func NewCreateService(ui terminal.UI, config core_config.Reader, serviceRepo api
}

func (cmd CreateService) Metadata() command_metadata.CommandMetadata {
return command_metadata.CommandMetadata{
Name: "create-service",
ShortName: "cs",
Description: T("Create a service instance"),
Usage: T(`CF_NAME create-service SERVICE PLAN SERVICE_INSTANCE [-c PARAMETERS_AS_JSON] [-t TAGS]
Optionally provide service-specific configuration parameters in a valid JSON object in-line:
CF_NAME create-service SERVICE PLAN SERVICE_INSTANCE -c '{"name":"value","name":"value"}'
baseUsage := T("CF_NAME create-service SERVICE PLAN SERVICE_INSTANCE [-c PARAMETERS_AS_JSON] [-t TAGS]")
paramsUsage := T(` Optionally provide service-specific configuration parameters in a valid JSON object in-line:
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_NAME create-service SERVICE_INSTANCE -c PATH_TO_FILE
CF_NAME create-service SERVICE PLAN SERVICE_INSTANCE -c '{"name":"value","name":"value"}'
Example of valid JSON object:
{
"cluster_nodes": {
"count": 5,
"memory_mb": 1024
}
}
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:
EXAMPLE:
Linux/Mac:
CF_NAME create-service db-service silver -c '{"ram_gb":4}'
CF_NAME create-service SERVICE_INSTANCE -c PATH_TO_FILE
Windows Command Line
CF_NAME create-service db-service silver -c "{\"ram_gb\":4}"
Example of valid JSON object:
{
"cluster_nodes": {
"count": 5,
"memory_mb": 1024
}
}`)
exampleUsage := T(`EXAMPLE:
Linux/Mac:
CF_NAME create-service db-service silver -c '{"ram_gb":4}'
Windows PowerShell
CF_NAME create-service db-service silver -c '{\"ram_gb\":4}'
Windows Command Line:
CF_NAME create-service db-service silver -c "{\"ram_gb\":4}"
CF_NAME create-service db-service silver mydb -c ~/workspace/tmp/instance_config.json
Windows PowerShell:
CF_NAME create-service db-service silver -c '{\"ram_gb\":4}'
CF_NAME create-service dbaas silver mydb -t "list, of, tags"
CF_NAME create-service db-service silver mydb -c ~/workspace/tmp/instance_config.json
TIP:
Use 'CF_NAME create-user-provided-service' to make user-provided services available to cf apps`),
CF_NAME create-service dbaas silver mydb -t "list, of, tags"`)
tipsUsage := T(`TIP:
Use 'CF_NAME create-user-provided-service' to make user-provided services available to cf apps`)
return command_metadata.CommandMetadata{
Name: "create-service",
ShortName: "cs",
Description: T("Create a service instance"),
Usage: strings.Join([]string{baseUsage, paramsUsage, exampleUsage, tipsUsage}, "\n\n"),
Flags: []cli.Flag{
flag_helpers.NewStringFlag("c", T("Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file. For a list of supported configuration parameters, see documentation for the particular service offering.")),
flag_helpers.NewStringFlag("t", T("User provided tags")),
Expand Down

0 comments on commit 38c010d

Please sign in to comment.