MCPcopy Create free account
hub / github.com/compozy/agh / handleAutomationJobs

Method handleAutomationJobs

internal/extension/host_api.go:1400–1435  ·  view source on GitHub ↗
(ctx context.Context, raw json.RawMessage)

Source from the content-addressed store, hash-verified

1398}
1399
1400func (h *HostAPIHandler) handleAutomationJobs(ctx context.Context, raw json.RawMessage) (any, error) {
1401 automation, err := h.automationManager()
1402 if err != nil {
1403 return nil, err
1404 }
1405
1406 var params hostAPIAutomationJobsParams
1407 if err := decodeHostAPIParams(raw, &params); err != nil {
1408 return nil, err
1409 }
1410
1411 workspaceID, err := h.resolveAutomationWorkspaceID(ctx, params.WorkspaceID)
1412 if err != nil {
1413 return nil, err
1414 }
1415
1416 jobs, err := automation.ListJobs(ctx, automationpkg.JobListQuery{
1417 Scope: params.Scope,
1418 WorkspaceID: workspaceID,
1419 })
1420 if err != nil {
1421 return nil, err
1422 }
1423
1424 if params.Enabled == nil {
1425 return jobs, nil
1426 }
1427
1428 filtered := make([]automationpkg.Job, 0, len(jobs))
1429 for _, job := range jobs {
1430 if job.Enabled == *params.Enabled {
1431 filtered = append(filtered, job)
1432 }
1433 }
1434 return filtered, nil
1435}
1436
1437func (h *HostAPIHandler) handleAutomationJobsGet(ctx context.Context, raw json.RawMessage) (any, error) {
1438 automation, err := h.automationManager()

Callers

nothing calls this directly

Calls 5

automationManagerMethod · 0.95
decodeHostAPIParamsFunction · 0.85
appendFunction · 0.85
ListJobsMethod · 0.65

Tested by

no test coverage detected