Skip to content

Commit aba5448

Browse files
authored
cmd: rephrase deployment create flag, error and help text (#278)
In order to improve UX, this PR substitutes the word "idempotency token" for "request ID". The help text is also slightly changed to make it more understandable.
1 parent ededc9a commit aba5448

File tree

4 files changed

+9
-29
lines changed

4 files changed

+9
-29
lines changed

cmd/deployment/create.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ var createCmd = &cobra.Command{
137137
res, err := deployment.Create(createParams)
138138
if err != nil {
139139
fmt.Fprintln(os.Stderr,
140-
"The deployment creation returned with an error, please use the displayed idempotency token to recreate the deployment resources",
140+
"The deployment creation returned with an error. Use the displayed request ID to recreate the deployment resources",
141141
)
142-
fmt.Fprintln(os.Stderr, "Idempotency token:", reqID)
142+
fmt.Fprintln(os.Stderr, "Request ID:", reqID)
143143
return err
144144
}
145145

@@ -162,7 +162,7 @@ func init() {
162162
createCmd.Flags().String("name", "", "Optional name for the deployment")
163163
createCmd.Flags().BoolP("track", "t", false, cmdutil.TrackFlagMessage)
164164
createCmd.Flags().Bool("generate-payload", false, "Returns the deployment payload without actually creating the deployment resources")
165-
createCmd.Flags().String("request-id", "", "Optional idempotency token - Can be found in the Stderr device when a previous deployment creation failed, for more information see the examples in the help command page")
165+
createCmd.Flags().String("request-id", "", "Optional request ID - Can be found in the Stderr device when a previous deployment creation failed. For more information see the examples in the help command page")
166166

167167
createCmd.Flags().String("es-ref-id", "main-elasticsearch", "Optional RefId for the Elasticsearch deployment")
168168
createCmd.Flags().Int32("es-zones", 1, "Number of zones the Elasticsearch instances will span")

cmd/deployment/create_help.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,7 @@ $ ecctl deployment create --name my-deployment --size 1024 --track --generate-pa
6868
## Create a deployment through the file definition.
6969
$ ecctl deployment create --file create_example.json --track
7070
71-
## To retry a when the previous deployment creation failed:
72-
$ ecctl deployment create
73-
The deployment creation returned with an error, please use the displayed idempotency token
74-
to recreate the deployment resources
75-
Idempotency token: GMZPMRrcMYqHdmxjIQkHbdjnhPIeBElcwrHwzVlhGUSMXrEIzVXoBykSVRsKncNb
76-
unknown error (status 500)
71+
## To retry a deployment when the previous deployment creation failed, use the request ID provided in the error response of the previous command:
7772
$ ecctl deployment create --request-id=GMZPMRrcMYqHdmxjIQkHbdjnhPIeBElcwrHwzVlhGUSMXrEIzVXoBykSVRsKncNb`
7873

7974
// Remove temporary constants when reads for deployment templates are available on ESS
@@ -89,11 +84,6 @@ $ deployment create --file create_example.json --track
8984
Deployment [b6ecbea3d5c84124b7dca457f2892086] - [Elasticsearch][b6ecbea3d5c84124b7dca457f2892086]: finished running all the plan steps (Total plan duration: 5m11.s)
9085
Deployment [91c4d60acb804ba0a27651fac02780ec] - [Kibana][8a9d9916cd6e46a7bb0912211d76e2af]: finished running all the plan steps (Total plan duration: 4m29.58s)
9186
92-
## To retry a when the previous deployment creation failed:
93-
$ ecctl deployment create --file create_example.json
94-
The deployment creation returned with an error, please use the displayed idempotency token
95-
to recreate the deployment resources
96-
Idempotency token: GMZPMRrcMYqHdmxjIQkHbdjnhPIeBElcwrHwzVlhGUSMXrEIzVXoBykSVRsKncNb
97-
unknown error (status 500)
87+
## To retry a deployment when the previous deployment creation failed, use the request ID provided in the error response of the previous command:
9888
$ ecctl deployment create --file create_example.json --request-id=GMZPMRrcMYqHdmxjIQkHbdjnhPIeBElcwrHwzVlhGUSMXrEIzVXoBykSVRsKncNb`
9989
)

docs/ecctl_deployment_create.adoc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ $ deployment create --file create_example.json --track
2626
Deployment [b6ecbea3d5c84124b7dca457f2892086] - [Elasticsearch][b6ecbea3d5c84124b7dca457f2892086]: finished running all the plan steps (Total plan duration: 5m11.s)
2727
Deployment [91c4d60acb804ba0a27651fac02780ec] - [Kibana][8a9d9916cd6e46a7bb0912211d76e2af]: finished running all the plan steps (Total plan duration: 4m29.58s)
2828
29-
## To retry a when the previous deployment creation failed:
30-
$ ecctl deployment create --file create_example.json
31-
The deployment creation returned with an error, please use the displayed idempotency token
32-
to recreate the deployment resources
33-
Idempotency token: GMZPMRrcMYqHdmxjIQkHbdjnhPIeBElcwrHwzVlhGUSMXrEIzVXoBykSVRsKncNb
34-
unknown error (status 500)
29+
## To retry a deployment when the previous deployment creation failed, use the request ID provided in the error response of the previous command:
3530
$ ecctl deployment create --file create_example.json --request-id=GMZPMRrcMYqHdmxjIQkHbdjnhPIeBElcwrHwzVlhGUSMXrEIzVXoBykSVRsKncNb
3631
----
3732

@@ -41,7 +36,7 @@ $ ecctl deployment create --file create_example.json --request-id=GMZPMRrcMYqHdm
4136
----
4237
-f, --file string DeploymentCreateRequest file definition. See help for more information
4338
-h, --help help for create
44-
--request-id string Optional idempotency token - Can be found in the Stderr device when a previous deployment creation failed, for more information see the examples in the help command page
39+
--request-id string Optional request ID - Can be found in the Stderr device when a previous deployment creation failed. For more information see the examples in the help command page
4540
-t, --track Tracks the progress of the performed task
4641
----
4742

docs/ecctl_deployment_create.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ $ deployment create --file create_example.json --track
2323
Deployment [b6ecbea3d5c84124b7dca457f2892086] - [Elasticsearch][b6ecbea3d5c84124b7dca457f2892086]: finished running all the plan steps (Total plan duration: 5m11.s)
2424
Deployment [91c4d60acb804ba0a27651fac02780ec] - [Kibana][8a9d9916cd6e46a7bb0912211d76e2af]: finished running all the plan steps (Total plan duration: 4m29.58s)
2525
26-
## To retry a when the previous deployment creation failed:
27-
$ ecctl deployment create --file create_example.json
28-
The deployment creation returned with an error, please use the displayed idempotency token
29-
to recreate the deployment resources
30-
Idempotency token: GMZPMRrcMYqHdmxjIQkHbdjnhPIeBElcwrHwzVlhGUSMXrEIzVXoBykSVRsKncNb
31-
unknown error (status 500)
26+
## To retry a deployment when the previous deployment creation failed, use the request ID provided in the error response of the previous command:
3227
$ ecctl deployment create --file create_example.json --request-id=GMZPMRrcMYqHdmxjIQkHbdjnhPIeBElcwrHwzVlhGUSMXrEIzVXoBykSVRsKncNb
3328
```
3429

@@ -37,7 +32,7 @@ $ ecctl deployment create --file create_example.json --request-id=GMZPMRrcMYqHdm
3732
```
3833
-f, --file string DeploymentCreateRequest file definition. See help for more information
3934
-h, --help help for create
40-
--request-id string Optional idempotency token - Can be found in the Stderr device when a previous deployment creation failed, for more information see the examples in the help command page
35+
--request-id string Optional request ID - Can be found in the Stderr device when a previous deployment creation failed. For more information see the examples in the help command page
4136
-t, --track Tracks the progress of the performed task
4237
```
4338

0 commit comments

Comments
 (0)