Class: Infrawrench::PostureDismissalsNamespace

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

Overview

client.posture.dismissals

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ PostureDismissalsNamespace

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 PostureDismissalsNamespace.

Parameters:



10231
10232
10233
# File 'lib/infrawrench/client.rb', line 10231

def initialize(transport)
  @transport = transport
end

Instance Method Details

#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash

Dismiss a posture finding

Accept a finding — the bucket really is meant to be public, the key really is rotated out of band. The finding leaves findings and stops feeding the daily posture alerts, but the rule keeps being evaluated and the finding is reported back under dismissed for as long as it still matches. Idempotent: dismissing an already-dismissed finding rewrites the note and the author.

Requires permission: resources:write.

POST /api/org/orgId/posture/dismissals

Raises on 400: Bad request

Parameters:

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

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

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

    Request body, shaped as PostureDismissalCreate.

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

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

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

Returns:

  • (Hash)

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

Raises:



10256
10257
10258
10259
10260
10261
10262
10263
10264
# File 'lib/infrawrench/client.rb', line 10256

def create(org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/posture/dismissals",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end

#delete(resource_id:, rule_id:, org_id: nil, request_options: nil) ⇒ nil

Restore a dismissed posture finding

Undo a dismissal, putting the finding back on the list and back into the alert feed. The finding is identified by query parameters rather than path segments because resource ids are provider-native and routinely contain slashes.

Requires permission: resources:write.

DELETE /api/org/orgId/posture/dismissals

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.

  • resource_id (String)

    Infrawrench resource id the finding is on.

  • rule_id (String)

    The matched rule's id.

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

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

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

Returns:

  • (nil)

    This endpoint returns no content.

Raises:



10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
# File 'lib/infrawrench/client.rb', line 10288

def delete(resource_id:, rule_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/posture/dismissals",
    path_params: { "orgId" => org_id },
    query: { "resourceId" => resource_id, "ruleId" => rule_id },
    accept: :empty,
    request_options: request_options
  )
end