Class: SDM::Query

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

Overview

A Query is a record of a single client request to a resource, such as an SQL query.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_email: nil, account_first_name: nil, account_id: nil, account_last_name: nil, account_tags: nil, duration: nil, egress_node_id: nil, encrypted: nil, id: nil, query_body: nil, query_category: nil, query_hash: nil, query_key: nil, record_count: nil, remote_identity_username: nil, replayable: nil, resource_id: nil, resource_name: nil, resource_tags: nil, resource_type: nil, timestamp: nil) ⇒ Query

Returns a new instance of Query.



5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
# File 'lib/models/porcelain.rb', line 5864

def initialize(
  account_email: nil,
  account_first_name: nil,
  account_id: nil,
  account_last_name: nil,
  account_tags: nil,
  duration: nil,
  egress_node_id: nil,
  encrypted: nil,
  id: nil,
  query_body: nil,
  query_category: nil,
  query_hash: nil,
  query_key: nil,
  record_count: nil,
  remote_identity_username: nil,
  replayable: nil,
  resource_id: nil,
  resource_name: nil,
  resource_tags: nil,
  resource_type: nil,
  timestamp: nil
)
  @account_email =  == nil ? "" : 
  @account_first_name =  == nil ? "" : 
  @account_id =  == nil ? "" : 
  @account_last_name =  == nil ? "" : 
  @account_tags =  == nil ? SDM::_porcelain_zero_value_tags() : 
  @duration = duration == nil ? nil : duration
  @egress_node_id = egress_node_id == nil ? "" : egress_node_id
  @encrypted = encrypted == nil ? false : encrypted
  @id = id == nil ? "" : id
  @query_body = query_body == nil ? "" : query_body
  @query_category = query_category == nil ? "" : query_category
  @query_hash = query_hash == nil ? "" : query_hash
  @query_key = query_key == nil ? "" : query_key
  @record_count = record_count == nil ? 0 : record_count
  @remote_identity_username = remote_identity_username == nil ? "" : remote_identity_username
  @replayable = replayable == nil ? false : replayable
  @resource_id = resource_id == nil ? "" : resource_id
  @resource_name = resource_name == nil ? "" : resource_name
  @resource_tags = resource_tags == nil ? SDM::_porcelain_zero_value_tags() : resource_tags
  @resource_type = resource_type == nil ? "" : resource_type
  @timestamp = timestamp == nil ? nil : timestamp
end

Instance Attribute Details

#account_emailObject

The email of the account performing this query, at the time the query was executed. If the account email is later changed, that change will not be reflected via this field.



5814
5815
5816
# File 'lib/models/porcelain.rb', line 5814

def 
  @account_email
end

#account_first_nameObject

The given name of the account performing this query, at the time the query was executed. If the account is later renamed, that change will not be reflected via this field.



5817
5818
5819
# File 'lib/models/porcelain.rb', line 5817

def 
  @account_first_name
end

#account_idObject

Unique identifier of the Account that performed the Query.



5819
5820
5821
# File 'lib/models/porcelain.rb', line 5819

def 
  @account_id
end

#account_last_nameObject

The family name of the account performing this query, at the time the query was executed. If the account is later renamed, that change will not be reflected via this field.



5822
5823
5824
# File 'lib/models/porcelain.rb', line 5822

def 
  @account_last_name
end

#account_tagsObject

The tags of the account accessed, at the time the query was executed. If the account tags are later changed, that change will not be reflected via this field.



5825
5826
5827
# File 'lib/models/porcelain.rb', line 5825

def 
  @account_tags
end

#durationObject

The duration of the Query.



5827
5828
5829
# File 'lib/models/porcelain.rb', line 5827

def duration
  @duration
end

#egress_node_idObject

The unique ID of the node through which the Resource was accessed.



5829
5830
5831
# File 'lib/models/porcelain.rb', line 5829

def egress_node_id
  @egress_node_id
end

#encryptedObject

Indicates that the body of the Query is encrypted.



5831
5832
5833
# File 'lib/models/porcelain.rb', line 5831

def encrypted
  @encrypted
end

#idObject

Unique identifier of the Query.



5833
5834
5835
# File 'lib/models/porcelain.rb', line 5833

def id
  @id
end

#query_bodyObject

The captured content of the Query.



5835
5836
5837
# File 'lib/models/porcelain.rb', line 5835

def query_body
  @query_body
end

#query_categoryObject

The general category of Resource against which Query was performed, e.g. "web" or "cloud".



5837
5838
5839
# File 'lib/models/porcelain.rb', line 5837

def query_category
  @query_category
end

#query_hashObject

The hash of the body of the Query.



5839
5840
5841
# File 'lib/models/porcelain.rb', line 5839

def query_hash
  @query_hash
end

#query_keyObject

The symmetric key used to encrypt the body of this Query and its replay if replayable. If the Query is encrypted, this field contains an encrypted symmetric key in base64 encoding. This key must be decrypted with the organization's private key to obtain the symmetric key needed to decrypt the body. If the Query is not encrypted, this field is empty.



5844
5845
5846
# File 'lib/models/porcelain.rb', line 5844

def query_key
  @query_key
end

#record_countObject

The number of records returned by the Query, for a database Resource.



5846
5847
5848
# File 'lib/models/porcelain.rb', line 5846

def record_count
  @record_count
end

#remote_identity_usernameObject

The username of the RemoteIdentity used to access the Resource.



5848
5849
5850
# File 'lib/models/porcelain.rb', line 5848

def remote_identity_username
  @remote_identity_username
end

#replayableObject

Indicates that the Query is replayable, e.g. for some SSH or K8s sessions.



5850
5851
5852
# File 'lib/models/porcelain.rb', line 5850

def replayable
  @replayable
end

#resource_idObject

Unique identifier of the Resource against which the Query was performed.



5852
5853
5854
# File 'lib/models/porcelain.rb', line 5852

def resource_id
  @resource_id
end

#resource_nameObject

The name of the resource accessed, at the time the query was executed. If the resource is later renamed, that change will not be reflected via this field.



5855
5856
5857
# File 'lib/models/porcelain.rb', line 5855

def resource_name
  @resource_name
end

#resource_tagsObject

The tags of the resource accessed, at the time the query was executed. If the resource tags are later changed, that change will not be reflected via this field.



5858
5859
5860
# File 'lib/models/porcelain.rb', line 5858

def resource_tags
  @resource_tags
end

#resource_typeObject

The specific type of Resource against which the Query was performed, e.g. "ssh" or "postgres".



5860
5861
5862
# File 'lib/models/porcelain.rb', line 5860

def resource_type
  @resource_type
end

#timestampObject

The time at which the Query was performed.



5862
5863
5864
# File 'lib/models/porcelain.rb', line 5862

def timestamp
  @timestamp
end

Instance Method Details

#to_json(options = {}) ⇒ Object



5910
5911
5912
5913
5914
5915
5916
# File 'lib/models/porcelain.rb', line 5910

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