Class: Infrawrench::SessionRecordingsNamespace

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

Overview

client.session_recordings

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ SessionRecordingsNamespace

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

Parameters:



12462
12463
12464
12465
# File 'lib/infrawrench/client.rb', line 12462

def initialize(transport)
  @transport = transport
  @settings = SessionRecordingsSettingsNamespace.new(@transport)
end

Instance Attribute Details

#settingsSessionRecordingsSettingsNamespace (readonly)

Returns client.session_recordings.settings.

Returns:



12458
12459
12460
# File 'lib/infrawrench/client.rb', line 12458

def settings
  @settings
end

Instance Method Details

#cast(recording_id:, org_id: nil, download: nil, request_options: nil) ⇒ String

Download a recording as an asciicast

The session as an asciicast v2 document: a JSON header line followed by one [time, code, data] event per line. Deliberately somebody else's format — the same bytes play in asciinema play and in the reference web player, so a recording is useful to an auditor who has never seen this product. ?download=1 returns it as an attachment. Every fetch is audit-logged, including this one: an investigator has to be able to answer who has watched a given tape.

Requires permission: session-recordings:read.

GET /api/org/orgId/session-recordings/recordingId/cast

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.

  • recording_id (String)
  • download (String, nil) (defaults to: nil)

    Force an attachment disposition.

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

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

  • recording_id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • download: ("1", nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (String)

    Raw response bytes.

Raises:



12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
# File 'lib/infrawrench/client.rb', line 12491

def cast(recording_id:, org_id: nil, download: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/session-recordings/{recordingId}/cast",
    path_params: { "orgId" => org_id, "recordingId" => recording_id },
    query: { "download" => download },
    accept: :binary,
    request_options: request_options
  )
end

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

Delete a recording

Removes the recording and its stored chunks. Audit-logged.

Requires permission: session-recordings:write.

DELETE /api/org/orgId/session-recordings/recordingId

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.

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

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

  • recording_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:



12518
12519
12520
12521
12522
12523
12524
12525
# File 'lib/infrawrench/client.rb', line 12518

def delete(recording_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/session-recordings/{recordingId}",
    path_params: { "orgId" => org_id, "recordingId" => recording_id },
    request_options: request_options
  )
end

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

Get one recording's metadata

Requires permission: session-recordings:read.

GET /api/org/orgId/session-recordings/recordingId

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.

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

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

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

Returns:

  • (Hash)

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

Raises:



12541
12542
12543
12544
12545
12546
12547
12548
# File 'lib/infrawrench/client.rb', line 12541

def get(recording_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/session-recordings/{recordingId}",
    path_params: { "orgId" => org_id, "recordingId" => recording_id },
    request_options: request_options
  )
end

#list(org_id: nil, status: nil, user_id: nil, resource_id: nil, account_id: nil, since: nil, until_param: nil, limit: nil, request_options: nil) ⇒ Array<Hash>

List recorded SSH sessions

Recorded sessions, newest first. Only SSH opened through the cloud is recorded — those sessions are already proxied by the server, so recording tees a stream it holds rather than requiring an agent on the host. A desktop session that dials a host directly never reaches the server and cannot appear here.

Requires permission: session-recordings:read.

GET /api/org/orgId/session-recordings

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.

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

    recording (live), complete (closed cleanly), truncated (hit the per-session capture ceiling — the tape is a genuine partial and says so), or abandoned (the server handling the session went away before it could close the row).

  • user_id (String, nil) (defaults to: nil)
  • resource_id (String, nil) (defaults to: nil)
  • account_id (String, nil) (defaults to: nil)
  • since (String, nil) (defaults to: nil)

    Inclusive lower bound on startedAt.

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

    Exclusive upper bound on startedAt.

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

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

  • org_id: (String, nil) (defaults to: nil)
  • status: ("recording", "complete", "truncated", "abandoned", nil) (defaults to: nil)
  • user_id: (String, nil) (defaults to: nil)
  • resource_id: (String, nil) (defaults to: nil)
  • account_id: (String, nil) (defaults to: nil)
  • since: (String, nil) (defaults to: nil)
  • until_param: (String, nil) (defaults to: nil)
  • limit: (Integer, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Array<Hash>)

    Parsed JSON, shaped as Array<SessionRecording> — see sig/infrawrench/sdk.rbs.

Raises:



12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
# File 'lib/infrawrench/client.rb', line 12579

def list(
  org_id: nil,
  status: nil,
  user_id: nil,
  resource_id: nil,
  account_id: nil,
  since: nil,
  until_param: nil,
  limit: nil,
  request_options: nil
)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/session-recordings",
    path_params: { "orgId" => org_id },
    query: {
      "status" => status,
      "userId" => user_id,
      "resourceId" => resource_id,
      "accountId" => ,
      "since" => since,
      "until" => until_param,
      "limit" => limit
    },
    request_options: request_options
  )
end