From 2d79005382453bf9ba0e5497508a9765c9b38ba8 Mon Sep 17 00:00:00 2001 From: danaelhe Date: Wed, 15 May 2024 14:11:03 -0400 Subject: [PATCH 1/2] droplet-actions: add necessary scopes to doctl description (poc) --- commands/droplet_actions.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/droplet_actions.go b/commands/droplet_actions.go index de8e4b0d5..f6847d48b 100644 --- a/commands/droplet_actions.go +++ b/commands/droplet_actions.go @@ -104,11 +104,12 @@ Droplets that are powered off are still billable. To stop incurring charges on a cmdDropletActionShutdown.Example = `The following example shuts down a Droplet with the ID ` + "`" + `386734086` + "`" + `: doctl compute droplet-action shutdown 386734086` cmdDropletActionPowerOff := CmdBuilder(cmd, RunDropletActionPowerOff, - "power-off ", "Power off a Droplet", `Use this command to power off a Droplet. + "power-off ", "Power off a Droplet", "\nDescription:"+"\n"+` Use this command to power off a Droplet. -A `+"`"+`power_off`+"`"+` event is a hard shutdown and should only be used if the shutdown action is not successful. It is similar to cutting the power on a server and could lead to complications. + A `+"`"+`power_off`+"`"+` event is a hard shutdown and should only be used if the shutdown action is not successful. + It is similar to cutting the power on a server and could lead to complications. -Droplets that are powered off are still billable. To stop incurring charges on a Droplet, destroy it.`, Writer, + Droplets that are powered off are still billable. To stop incurring charges on a Droplet, destroy it.`+"\n\nScopes:"+"\n"+" actions:read, droplet:update", Writer, displayerType(&displayers.Action{})) AddBoolFlag(cmdDropletActionPowerOff, doctl.ArgCommandWait, "", false, "Instruct the terminal to wait for the action to complete before returning access to the user") cmdDropletActionPowerOff.Example = `The following example powers off a Droplet with the ID ` + "`" + `386734086` + "`" + `: doctl compute droplet-action power-off 386734086` From d9874bddabc34f668160180f748ff5f05bbdf9ae Mon Sep 17 00:00:00 2001 From: danaelhe Date: Wed, 15 May 2024 14:26:09 -0400 Subject: [PATCH 2/2] scopes to customer scopes --- commands/droplet_actions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/droplet_actions.go b/commands/droplet_actions.go index f6847d48b..1040ba810 100644 --- a/commands/droplet_actions.go +++ b/commands/droplet_actions.go @@ -109,7 +109,7 @@ Droplets that are powered off are still billable. To stop incurring charges on a A `+"`"+`power_off`+"`"+` event is a hard shutdown and should only be used if the shutdown action is not successful. It is similar to cutting the power on a server and could lead to complications. - Droplets that are powered off are still billable. To stop incurring charges on a Droplet, destroy it.`+"\n\nScopes:"+"\n"+" actions:read, droplet:update", Writer, + Droplets that are powered off are still billable. To stop incurring charges on a Droplet, destroy it.`+"\n\nCustom Scopes:"+"\n"+" actions:read, droplet:update", Writer, displayerType(&displayers.Action{})) AddBoolFlag(cmdDropletActionPowerOff, doctl.ArgCommandWait, "", false, "Instruct the terminal to wait for the action to complete before returning access to the user") cmdDropletActionPowerOff.Example = `The following example powers off a Droplet with the ID ` + "`" + `386734086` + "`" + `: doctl compute droplet-action power-off 386734086`