Class: SDM::QueryCapture

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

A QueryCapture contains additional information about queries against SSH, Kubernetes, and RDP resources.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_command: nil, command: nil, container: nil, env: nil, file_name: nil, file_size: nil, height: nil, pod: nil, request_body: nil, request_method: nil, request_uri: nil, type: nil, width: nil) ⇒ QueryCapture

Returns a new instance of QueryCapture.



8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
# File 'lib/models/porcelain.rb', line 8563

def initialize(
  client_command: nil,
  command: nil,
  container: nil,
  env: nil,
  file_name: nil,
  file_size: nil,
  height: nil,
  pod: nil,
  request_body: nil,
  request_method: nil,
  request_uri: nil,
  type: nil,
  width: nil
)
  @client_command = client_command == nil ? "" : client_command
  @command = command == nil ? "" : command
  @container = container == nil ? "" : container
  @env = env == nil ? {} : env
  @file_name = file_name == nil ? "" : file_name
  @file_size = file_size == nil ? 0 : file_size
  @height = height == nil ? 0 : height
  @pod = pod == nil ? "" : pod
  @request_body = request_body == nil ? "" : request_body
  @request_method = request_method == nil ? "" : request_method
  @request_uri = request_uri == nil ? "" : request_uri
  @type = type == nil ? "" : type
  @width = width == nil ? 0 : width
end

Instance Attribute Details

#client_commandObject

The command executed on the client for a Kubernetes session.



8537
8538
8539
# File 'lib/models/porcelain.rb', line 8537

def client_command
  @client_command
end

#commandObject

The command executed over an SSH or Kubernetes session.



8539
8540
8541
# File 'lib/models/porcelain.rb', line 8539

def command
  @command
end

#containerObject

The target container of a Kubernetes operation.



8541
8542
8543
# File 'lib/models/porcelain.rb', line 8541

def container
  @container
end

#envObject

The environment variables for an SSH or Kubernetes session.



8543
8544
8545
# File 'lib/models/porcelain.rb', line 8543

def env
  @env
end

#file_nameObject

The remote file name of an SCP operation.



8545
8546
8547
# File 'lib/models/porcelain.rb', line 8545

def file_name
  @file_name
end

#file_sizeObject

The file size transferred for an SCP operation.



8547
8548
8549
# File 'lib/models/porcelain.rb', line 8547

def file_size
  @file_size
end

#heightObject

The height of the terminal or window for SSH, Kubernetes, and RDP interactive sessions.



8549
8550
8551
# File 'lib/models/porcelain.rb', line 8549

def height
  @height
end

#podObject

The target pod of a Kubernetes operation.



8551
8552
8553
# File 'lib/models/porcelain.rb', line 8551

def pod
  @pod
end

#request_bodyObject

The HTTP request body of a Kubernetes operation.



8553
8554
8555
# File 'lib/models/porcelain.rb', line 8553

def request_body
  @request_body
end

#request_methodObject

The HTTP request method of a Kubernetes operation.



8555
8556
8557
# File 'lib/models/porcelain.rb', line 8555

def request_method
  @request_method
end

#request_uriObject

The HTTP request URI of a Kubernetes operation.



8557
8558
8559
# File 'lib/models/porcelain.rb', line 8557

def request_uri
  @request_uri
end

#typeObject

The CaptureType of this query capture, one of the CaptureType constants.



8559
8560
8561
# File 'lib/models/porcelain.rb', line 8559

def type
  @type
end

#widthObject

The width of the terminal or window for SSH, Kubernetes, and RDP interactive sessions.



8561
8562
8563
# File 'lib/models/porcelain.rb', line 8561

def width
  @width
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8593
8594
8595
8596
8597
8598
8599
# File 'lib/models/porcelain.rb', line 8593

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end