Class: SDM::Query
- Inherits:
-
Object
- Object
- SDM::Query
- 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
-
#account_email ⇒ Object
The email of the account performing this query, at the time the query was executed.
-
#account_first_name ⇒ Object
The given name of the account performing this query, at the time the query was executed.
-
#account_id ⇒ Object
Unique identifier of the Account that performed the Query.
-
#account_last_name ⇒ Object
The family name of the account performing this query, at the time the query was executed.
-
#account_tags ⇒ Object
The tags of the account accessed, at the time the query was executed.
-
#duration ⇒ Object
The duration of the Query.
-
#egress_node_id ⇒ Object
The unique ID of the node through which the Resource was accessed.
-
#encrypted ⇒ Object
Indicates that the body of the Query is encrypted.
-
#id ⇒ Object
Unique identifier of the Query.
-
#query_body ⇒ Object
The captured content of the Query.
-
#query_category ⇒ Object
The general category of Resource against which Query was performed, e.g.
-
#query_hash ⇒ Object
The hash of the body of the Query.
-
#query_key ⇒ Object
The symmetric key used to encrypt the body of this Query and its replay if replayable.
-
#record_count ⇒ Object
The number of records returned by the Query, for a database Resource.
-
#remote_identity_username ⇒ Object
The username of the RemoteIdentity used to access the Resource.
-
#replayable ⇒ Object
Indicates that the Query is replayable, e.g.
-
#resource_id ⇒ Object
Unique identifier of the Resource against which the Query was performed.
-
#resource_name ⇒ Object
The name of the resource accessed, at the time the query was executed.
-
#resource_tags ⇒ Object
The tags of the resource accessed, at the time the query was executed.
-
#resource_type ⇒ Object
The specific type of Resource against which the Query was performed, e.g.
-
#timestamp ⇒ Object
The time at which the Query was performed.
Instance Method Summary collapse
-
#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
constructor
A new instance of Query.
- #to_json(options = {}) ⇒ Object
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 = account_email == nil ? "" : account_email @account_first_name = account_first_name == nil ? "" : account_first_name @account_id = account_id == nil ? "" : account_id @account_last_name = account_last_name == nil ? "" : account_last_name @account_tags = == nil ? SDM::() : @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 = == nil ? SDM::() : @resource_type = resource_type == nil ? "" : resource_type @timestamp = == nil ? nil : end |
Instance Attribute Details
#account_email ⇒ Object
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 @account_email end |
#account_first_name ⇒ Object
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 @account_first_name end |
#account_id ⇒ Object
Unique identifier of the Account that performed the Query.
5854 5855 5856 |
# File 'lib/models/porcelain.rb', line 5854 def account_id @account_id end |
#account_last_name ⇒ Object
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 @account_last_name end |
#account_tags ⇒ Object
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 |
#duration ⇒ Object
The duration of the Query.
5862 5863 5864 |
# File 'lib/models/porcelain.rb', line 5862 def duration @duration end |
#egress_node_id ⇒ Object
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 |
#encrypted ⇒ Object
Indicates that the body of the Query is encrypted.
5866 5867 5868 |
# File 'lib/models/porcelain.rb', line 5866 def encrypted @encrypted end |
#id ⇒ Object
Unique identifier of the Query.
5868 5869 5870 |
# File 'lib/models/porcelain.rb', line 5868 def id @id end |
#query_body ⇒ Object
The captured content of the Query.
5870 5871 5872 |
# File 'lib/models/porcelain.rb', line 5870 def query_body @query_body end |
#query_category ⇒ Object
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_hash ⇒ Object
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_key ⇒ Object
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_count ⇒ Object
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_username ⇒ Object
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 |
#replayable ⇒ Object
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_id ⇒ Object
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_name ⇒ Object
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_tags ⇒ Object
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 end |
#resource_type ⇒ Object
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 |
#timestamp ⇒ Object
The time at which the Query was performed.
5897 5898 5899 |
# File 'lib/models/porcelain.rb', line 5897 def @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( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |