You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: commands/apps.go
+128-9Lines changed: 128 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -201,8 +201,8 @@ Only basic information is included with the text output format. For complete app
201
201
displayerType(&displayers.JobInvocations{}),
202
202
)
203
203
204
-
AddStringSliceFlag(listJobInvocations, doctl.ArgAppDeployment, "", []string{}, "The deployment ID to filter job invocations for. If not provided, all job invocations for given app are returned.")
205
-
AddStringSliceFlag(listJobInvocations, doctl.ArgAppJobName, "", []string{}, "The job name to filter job invocations for. If not provided, all job invocations for given app are returned.")
204
+
AddStringFlag(listJobInvocations, doctl.ArgAppDeployment, "", "", "The deployment ID to filter job invocations for. If not provided, all job invocations for given app are returned.")
205
+
AddStringFlag(listJobInvocations, doctl.ArgAppJobName, "", "", "The job name to filter job invocations for. If not provided, all job invocations for given app are returned.")
206
206
207
207
listJobInvocations.Example=`The following example retrieves the list of job invocations for the app with the ID `+"`"+`f81d4fae-7dec-11d0-a765-00a0c91e6bf6`+"`"+` and the deployment ID `+"`"+`418b7972-fc67-41ea-ab4b-6f9477c4f7d8`+"`"+` and the job `+"`"+`cron`+"`"+`: doctl apps list-job-invocations f81d4fae-7dec-11d0-a765-00a0c91e6bf6 --job-name cron --deployment 418b7972-fc67-41ea-ab4b-6f9477c4f7d8`
208
208
@@ -232,20 +232,64 @@ Only basic information is included with the text output format. For the complete
232
232
displayerType(&displayers.JobInvocations{}),
233
233
)
234
234
235
+
listEvents:=CmdBuilder(
236
+
cmd,
237
+
RunAppsListEvents,
238
+
"list-events <app id>",
239
+
"List app events",
240
+
`Lists all events for the given app, including deployments and autoscaling events.
241
+
242
+
Only basic information is included with the text output format. For the complete event details, use the `+"`"+`--output`+"`"+` global flag and specify the JSON format.`,
243
+
Writer,
244
+
aliasOpt("lse"),
245
+
displayerType(&displayers.Events{}),
246
+
)
247
+
AddStringSliceFlag(listEvents, doctl.ArgAppEventType, "", []string{}, "Filter events by type (e.g. DEPLOYMENT, AUTOSCALING).")
248
+
249
+
listEvents.Example=`The following example retrieves the list of events for the app with the ID `+"`"+`f81d4fae-7dec-11d0-a765-00a0c91e6bf6`+"`"+`: doctl apps list-events f81d4fae-7dec-11d0-a765-00a0c91e6bf6`
250
+
251
+
CmdBuilder(
252
+
cmd,
253
+
RunAppsCancelEvent,
254
+
"cancel-event <app id> <event id>",
255
+
"Cancel an event",
256
+
`Cancels an in-progress autoscaling event for the given app.
257
+
258
+
Only basic information is included with the text output format. For the complete event details, use the `+"`"+`--output`+"`"+` global flag and specify the JSON format.`,
259
+
Writer,
260
+
aliasOpt("ce"),
261
+
displayerType(&displayers.Events{}),
262
+
)
263
+
264
+
CmdBuilder(
265
+
cmd,
266
+
RunAppsGetEvent,
267
+
"get-event <app id> <event id>",
268
+
"Get an event",
269
+
`Gets a single event for the given app.
270
+
271
+
Only basic information is included with the text output format. For the complete event details, use the `+"`"+`--output`+"`"+` global flag and specify the JSON format.`,
272
+
Writer,
273
+
aliasOpt("ge"),
274
+
displayerType(&displayers.Events{}),
275
+
)
276
+
235
277
logs:=CmdBuilder(
236
278
cmd,
237
279
RunAppsGetLogs,
238
280
"logs <app name or id> <component name (defaults to all components)>",
239
281
"Retrieves logs",
240
-
`Retrieves component logs for a deployment or a job invocation of an app.
282
+
`Retrieves component logs for a deployment, a job invocation, or an autoscaling event of an app.
241
283
242
-
Three types of logs are supported and can be specified with the --`+doctl.ArgAppLogType+` flag:
284
+
These types of logs are supported and can be specified with the --`+doctl.ArgAppLogType+` flag:
243
285
- build
244
286
- deploy
245
287
- run
246
288
- run_restarted
289
+
- autoscale_event
247
290
248
291
To retrieve job invocation logs, pass the job invocation ID with the --`+doctl.ArgAppJobInvocation+` flag.
292
+
To retrieve autoscaling event logs, pass the event ID with the --`+doctl.ArgAppEventID+` flag.
249
293
250
294
For more information about logs, see [How to View Logs](https://www.digitalocean.com/docs/app-platform/how-to/view-logs/).
251
295
`,
@@ -254,6 +298,7 @@ For more information about logs, see [How to View Logs](https://www.digitalocean
254
298
)
255
299
AddStringFlag(logs, doctl.ArgAppDeployment, "", "", "Retrieves logs for a specific deployment ID. Defaults to current deployment.")
256
300
AddStringFlag(logs, doctl.ArgAppJobInvocation, "", "", "Retrieves logs for a specific job invocation ID.")
301
+
AddStringFlag(logs, doctl.ArgAppEventID, "", "", "Retrieves logs for a specific autoscaling event ID.")
257
302
AddStringFlag(logs, doctl.ArgAppLogType, "", strings.ToLower(string(godo.AppLogTypeRun)), "Retrieves logs for a specific log type. Defaults to run logs.")
258
303
AddBoolFlag(logs, doctl.ArgAppLogFollow, "f", false, "Returns logs as they are emitted by the app.")
259
304
AddIntFlag(logs, doctl.ArgAppLogTail, "", -1, "Specifies the number of lines to show from the end of the log.")
0 commit comments