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.
5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 |
# File 'lib/models/porcelain.rb', line 5656 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.
5606 5607 5608 |
# File 'lib/models/porcelain.rb', line 5606 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.
5609 5610 5611 |
# File 'lib/models/porcelain.rb', line 5609 def account_first_name @account_first_name end |
#account_id ⇒ Object
Unique identifier of the Account that performed the Query.
5611 5612 5613 |
# File 'lib/models/porcelain.rb', line 5611 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.
5614 5615 5616 |
# File 'lib/models/porcelain.rb', line 5614 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.
5617 5618 5619 |
# File 'lib/models/porcelain.rb', line 5617 def @account_tags end |
#duration ⇒ Object
The duration of the Query.
5619 5620 5621 |
# File 'lib/models/porcelain.rb', line 5619 def duration @duration end |
#egress_node_id ⇒ Object
The unique ID of the node through which the Resource was accessed.
5621 5622 5623 |
# File 'lib/models/porcelain.rb', line 5621 def egress_node_id @egress_node_id end |
#encrypted ⇒ Object
Indicates that the body of the Query is encrypted.
5623 5624 5625 |
# File 'lib/models/porcelain.rb', line 5623 def encrypted @encrypted end |
#id ⇒ Object
Unique identifier of the Query.
5625 5626 5627 |
# File 'lib/models/porcelain.rb', line 5625 def id @id end |
#query_body ⇒ Object
The captured content of the Query.
5627 5628 5629 |
# File 'lib/models/porcelain.rb', line 5627 def query_body @query_body end |
#query_category ⇒ Object
The general category of Resource against which Query was performed, e.g. "web" or "cloud".
5629 5630 5631 |
# File 'lib/models/porcelain.rb', line 5629 def query_category @query_category end |
#query_hash ⇒ Object
The hash of the body of the Query.
5631 5632 5633 |
# File 'lib/models/porcelain.rb', line 5631 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.
5636 5637 5638 |
# File 'lib/models/porcelain.rb', line 5636 def query_key @query_key end |
#record_count ⇒ Object
The number of records returned by the Query, for a database Resource.
5638 5639 5640 |
# File 'lib/models/porcelain.rb', line 5638 def record_count @record_count end |
#remote_identity_username ⇒ Object
The username of the RemoteIdentity used to access the Resource.
5640 5641 5642 |
# File 'lib/models/porcelain.rb', line 5640 def remote_identity_username @remote_identity_username end |
#replayable ⇒ Object
Indicates that the Query is replayable, e.g. for some SSH or K8s sessions.
5642 5643 5644 |
# File 'lib/models/porcelain.rb', line 5642 def replayable @replayable end |
#resource_id ⇒ Object
Unique identifier of the Resource against which the Query was performed.
5644 5645 5646 |
# File 'lib/models/porcelain.rb', line 5644 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.
5647 5648 5649 |
# File 'lib/models/porcelain.rb', line 5647 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.
5650 5651 5652 |
# File 'lib/models/porcelain.rb', line 5650 def @resource_tags end |
#resource_type ⇒ Object
The specific type of Resource against which the Query was performed, e.g. "ssh" or "postgres".
5652 5653 5654 |
# File 'lib/models/porcelain.rb', line 5652 def resource_type @resource_type end |
#timestamp ⇒ Object
The time at which the Query was performed.
5654 5655 5656 |
# File 'lib/models/porcelain.rb', line 5654 def @timestamp end |
Instance Method Details
#to_json(options = {}) ⇒ Object
5702 5703 5704 5705 5706 5707 5708 |
# File 'lib/models/porcelain.rb', line 5702 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 |