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.
5274 5275 5276 |
# File 'lib/infrawrench/client.rb', line 5274 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
5296 5297 5298 5299 5300 5301 5302 5303 |
# File 'lib/infrawrench/client.rb', line 5296 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
5323 5324 5325 5326 5327 5328 5329 5330 |
# File 'lib/infrawrench/client.rb', line 5323 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
5353 5354 5355 5356 5357 5358 5359 5360 5361 |
# File 'lib/infrawrench/client.rb', line 5353 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 |