Class: Infrawrench::WorkflowsScheduleNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.workflows.schedule

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ WorkflowsScheduleNamespace

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of WorkflowsScheduleNamespace.

Parameters:



5933
5934
5935
# File 'lib/infrawrench/client.rb', line 5933

def initialize(transport)
  @transport = transport
end

Instance Method Details

#delete(id:, org_id: nil, request_options: nil) ⇒ Hash

Remove a workflow's cron schedule

Reverts the workflow's trigger to manual and clears the pending fire time. A no-op when the trigger is not cron.

Requires permission: dashboards:write.

DELETE /api/org/orgId/workflows/id/schedule

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)

    Workflow id

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as Ok — see sig/infrawrench/sdk.rbs.

Raises:



5954
5955
5956
5957
5958
5959
5960
5961
# File 'lib/infrawrench/client.rb', line 5954

def delete(id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/workflows/{id}/schedule",
    path_params: { "orgId" => org_id, "id" => id },
    request_options: request_options
  )
end

#get(id:, org_id: nil, request_options: nil) ⇒ Hash

Get a workflow's cron schedule

The schedule view of the workflow's trigger, with the next few computed fire times. schedule is null when the workflow is triggered some other way (manual, git, budget).

Requires permission: dashboards:read.

GET /api/org/orgId/workflows/id/schedule

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)

    Workflow id

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as WorkflowScheduleResponse — see sig/infrawrench/sdk.rbs.

Raises:



5982
5983
5984
5985
5986
5987
5988
5989
# File 'lib/infrawrench/client.rb', line 5982

def get(id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/workflows/{id}/schedule",
    path_params: { "orgId" => org_id, "id" => id },
    request_options: request_options
  )
end

#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash

Create or replace a workflow's cron schedule

Sets the workflow's trigger to cron with the given expression and timezone, validating both, and computes the next fire time. The workflow fires at the schedule's next occurrence — never immediately on save.

Requires permission: dashboards:write.

PUT /api/org/orgId/workflows/id/schedule

Raises on 400: Bad request

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)

    Workflow id

  • body (Hash)

    Request body, shaped as WorkflowScheduleInput.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • id: (String)
  • body: (workflow_schedule_input)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as WorkflowScheduleResponse — see sig/infrawrench/sdk.rbs.

Raises:



6013
6014
6015
6016
6017
6018
6019
6020
6021
# File 'lib/infrawrench/client.rb', line 6013

def update(id:, body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "PUT",
    path: "/api/org/{orgId}/workflows/{id}/schedule",
    path_params: { "orgId" => org_id, "id" => id },
    body: body,
    request_options: request_options
  )
end