Class: Infrawrench::WorkflowApprovalsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::WorkflowApprovalsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.workflow_approvals
Instance Method Summary collapse
-
#approve(id:, org_id: nil, request_options: nil) ⇒ Hash
Approve a pending workflow approval request.
-
#deny(id:, org_id: nil, request_options: nil) ⇒ Hash
Deny a pending workflow approval request.
-
#initialize(transport) ⇒ WorkflowApprovalsNamespace
constructor
private
A new instance of WorkflowApprovalsNamespace.
-
#list(org_id: nil, status: nil, workflow_id: nil, run_id: nil, request_options: nil) ⇒ Array<Hash>
List workflow approval requests.
Constructor Details
#initialize(transport) ⇒ WorkflowApprovalsNamespace
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 WorkflowApprovalsNamespace.
5571 5572 5573 |
# File 'lib/infrawrench/client.rb', line 5571 def initialize(transport) @transport = transport end |
Instance Method Details
#approve(id:, org_id: nil, request_options: nil) ⇒ Hash
Approve a pending workflow approval request
The suspended run resumes within a few seconds of the decision landing.
Requires permission: dashboards:write.
POST /api/org/orgId/workflow-approvals/id/approve
Raises on 404: Not found
Raises on 409: Conflict
5593 5594 5595 5596 5597 5598 5599 5600 |
# File 'lib/infrawrench/client.rb', line 5593 def approve(id:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/workflow-approvals/{id}/approve", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#deny(id:, org_id: nil, request_options: nil) ⇒ Hash
Deny a pending workflow approval request
Denial fails the waiting infra.waitForApproval(...) call in the run.
Requires permission: dashboards:write.
POST /api/org/orgId/workflow-approvals/id/deny
Raises on 404: Not found
Raises on 409: Conflict
5620 5621 5622 5623 5624 5625 5626 5627 |
# File 'lib/infrawrench/client.rb', line 5620 def deny(id:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/workflow-approvals/{id}/deny", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#list(org_id: nil, status: nil, workflow_id: nil, run_id: nil, request_options: nil) ⇒ Array<Hash>
List workflow approval requests
Approval requests raised by infra.waitForApproval(...) inside workflow
runs, newest first. Filter with status=pending to build an approvals
inbox.
Requires permission: dashboards:read.
GET /api/org/orgId/workflow-approvals
Raises on 400: Bad request
5650 5651 5652 5653 5654 5655 5656 5657 5658 |
# File 'lib/infrawrench/client.rb', line 5650 def list(org_id: nil, status: nil, workflow_id: nil, run_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/workflow-approvals", path_params: { "orgId" => org_id }, query: { "status" => status, "workflowId" => workflow_id, "runId" => run_id }, request_options: ) end |