-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update user-provided service tags #474
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e6cde1f
Add optional tags to create-service
tanglisha 24385b0
Refactor update service
mmb 2575aa0
Update service without changing plan works
rainmaker 7f32b9d
Update service can pass instance tags
mmb 8d9b7c1
Split long usage for update-service
rainmaker d668144
Split bind-service usage for easier translation
rainmaker 2b63522
Merge branch 'master' into cli_update_service_tags
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package service | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/cloudfoundry/cli/cf" | ||
"github.com/cloudfoundry/cli/cf/api" | ||
"github.com/cloudfoundry/cli/cf/command_metadata" | ||
|
@@ -36,37 +38,36 @@ func NewBindService(ui terminal.UI, config core_config.Reader, serviceBindingRep | |
} | ||
|
||
func (cmd *BindService) Metadata() command_metadata.CommandMetadata { | ||
return command_metadata.CommandMetadata{ | ||
Name: "bind-service", | ||
ShortName: "bs", | ||
Description: T("Bind a service instance to an app"), | ||
Usage: T(`CF_NAME bind-service APP_NAME SERVICE_INSTANCE [-c PARAMETERS_AS_JSON] | ||
baseUsage := T("CF_NAME bind-service APP_NAME SERVICE_INSTANCE [-c PARAMETERS_AS_JSON]") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, thanks for the nicely formatted string! |
||
paramsUsage := T(` Optionally provide service-specific configuration parameters in a valid JSON object in-line: | ||
|
||
Optionally provide service-specific configuration parameters in a valid JSON object in-line. | ||
CF_NAME bind-service APP_NAME SERVICE_INSTANCE -c '{"name":"value","name":"value"}' | ||
CF_NAME 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_NAME bind-service APP_NAME SERVICE_INSTANCE -c PATH_TO_FILE | ||
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 bind-service APP_NAME SERVICE_INSTANCE -c PATH_TO_FILE | ||
|
||
Example of valid JSON object: | ||
{ | ||
"cluster_nodes": { | ||
"count": 5, | ||
"memory_mb": 1024 | ||
} | ||
} | ||
|
||
EXAMPLE: | ||
Linux/Mac: | ||
CF_NAME bind-service myapp mydb -c '{"permissions":"read-only"}' | ||
"permissions": "read-only" | ||
}`) | ||
exampleUsage := T(`EXAMPLE: | ||
Linux/Mac: | ||
CF_NAME bind-service myapp mydb -c '{"permissions":"read-only"}' | ||
|
||
Windows Command Line | ||
CF_NAME bind-service myapp mydb -c "{\"permissions\":\"read-only\"}" | ||
Windows Command Line: | ||
CF_NAME bind-service myapp mydb -c "{\"permissions\":\"read-only\"}" | ||
|
||
Windows PowerShell | ||
CF_NAME bind-service myapp mydb -c '{\"permissions\":\"read-only\"}' | ||
Windows PowerShell: | ||
CF_NAME bind-service myapp mydb -c '{\"permissions\":\"read-only\"}' | ||
|
||
CF_NAME bind-service myapp mydb -c ~/workspace/tmp/instance_config.json`), | ||
CF_NAME bind-service myapp mydb -c ~/workspace/tmp/instance_config.json`) | ||
|
||
return command_metadata.CommandMetadata{ | ||
Name: "bind-service", | ||
ShortName: "bs", | ||
Description: T("Bind a service instance to an app"), | ||
Usage: strings.Join([]string{baseUsage, paramsUsage, exampleUsage}, "\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.")), | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of hate seeing these
nil
s all over the place when we could use empty string array... But eh, that's just me.Though hopefully we are testing for case when tags is empty array vs nil...