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.



5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
# File 'lib/models/porcelain.rb', line 5899

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.



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

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.



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

def 
  @account_first_name
end

#account_idObject

Unique identifier of the Account that performed the Query.



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

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.



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

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.



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

def 
  @account_tags
end

#durationObject

The duration of the Query.



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

def duration
  @duration
end

#egress_node_idObject

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



5864
5865
5866
# File 'lib/models/porcelain.rb', line 5864

def egress_node_id
  @egress_node_id
end

#encryptedObject

Indicates that the body of the Query is encrypted.



5866
5867
5868
# File 'lib/models/porcelain.rb', line 5866

def encrypted
  @encrypted
end

#idObject

Unique identifier of the Query.



5868
5869
5870
# File 'lib/models/porcelain.rb', line 5868

def id
  @id
end

#query_bodyObject

The captured content of the Query.



5870
5871
5872
# File 'lib/models/porcelain.rb', line 5870

def query_body
  @query_body
end

#query_categoryObject

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



5872
5873
5874
# File 'lib/models/porcelain.rb', line 5872

def query_category
  @query_category
end

#query_hashObject

The hash of the body of the Query.



5874
5875
5876
# File 'lib/models/porcelain.rb', line 5874

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.



5879
5880
5881
# File 'lib/models/porcelain.rb', line 5879

def query_key
  @query_key
end

#record_countObject

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



5881
5882
5883
# File 'lib/models/porcelain.rb', line 5881

def record_count
  @record_count
end

#remote_identity_usernameObject

The username of the RemoteIdentity used to access the Resource.



5883
5884
5885
# File 'lib/models/porcelain.rb', line 5883

def remote_identity_username
  @remote_identity_username
end

#replayableObject

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



5885
5886
5887
# File 'lib/models/porcelain.rb', line 5885

def replayable
  @replayable
end

#resource_idObject

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



5887
5888
5889
# File 'lib/models/porcelain.rb', line 5887

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.



5890
5891
5892
# File 'lib/models/porcelain.rb', line 5890

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.



5893
5894
5895
# File 'lib/models/porcelain.rb', line 5893

def resource_tags
  @resource_tags
end

#resource_typeObject

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



5895
5896
5897
# File 'lib/models/porcelain.rb', line 5895

def resource_type
  @resource_type
end

#timestampObject

The time at which the Query was performed.



5897
5898
5899
# File 'lib/models/porcelain.rb', line 5897

def timestamp
  @timestamp
end

Instance Method Details

#to_json(options = {}) ⇒ Object



5945
5946
5947
5948
5949
5950
5951
# File 'lib/models/porcelain.rb', line 5945

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