Class: SDM::Activity
- Inherits:
-
Object
- Object
- SDM::Activity
- Defined in:
- lib/models/porcelain.rb
Overview
An Activity is a record of an action taken against a strongDM deployment, e.g. a user creation, resource deletion, sso configuration change, etc.
Instance Attribute Summary collapse
-
#actor ⇒ Object
The account who executed this activity.
-
#completed_at ⇒ Object
The time this activity took effect.
-
#description ⇒ Object
A humanized description of the activity.
-
#entities ⇒ Object
The entities involved in this activity.
-
#id ⇒ Object
Unique identifier of the Activity.
-
#ip_address ⇒ Object
The IP from which this action was taken.
-
#user_agent ⇒ Object
The User Agent present when this request was executed.
-
#verb ⇒ Object
The kind of activity which has taken place, one of the ActivityVerb constants.
Instance Method Summary collapse
-
#initialize(actor: nil, completed_at: nil, description: nil, entities: nil, id: nil, ip_address: nil, user_agent: nil, verb: nil) ⇒ Activity
constructor
A new instance of Activity.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(actor: nil, completed_at: nil, description: nil, entities: nil, id: nil, ip_address: nil, user_agent: nil, verb: nil) ⇒ Activity
Returns a new instance of Activity.
1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 |
# File 'lib/models/porcelain.rb', line 1826 def initialize( actor: nil, completed_at: nil, description: nil, entities: nil, id: nil, ip_address: nil, user_agent: nil, verb: nil ) @actor = actor == nil ? nil : actor @completed_at = completed_at == nil ? nil : completed_at @description = description == nil ? "" : description @entities = entities == nil ? [] : entities @id = id == nil ? "" : id @ip_address = ip_address == nil ? "" : ip_address @user_agent = user_agent == nil ? "" : user_agent @verb = verb == nil ? "" : verb end |
Instance Attribute Details
#actor ⇒ Object
The account who executed this activity. If the actor later has a name or email change, that change is not reflected here. Actor is a snapshot of the executing account at the time an activity took place.
1807 1808 1809 |
# File 'lib/models/porcelain.rb', line 1807 def actor @actor end |
#completed_at ⇒ Object
The time this activity took effect.
1809 1810 1811 |
# File 'lib/models/porcelain.rb', line 1809 def completed_at @completed_at end |
#description ⇒ Object
A humanized description of the activity.
1811 1812 1813 |
# File 'lib/models/porcelain.rb', line 1811 def description @description end |
#entities ⇒ Object
The entities involved in this activity. These entities can be any first class entity in the strongDM system, eg. a user, a role, a node, an account grant. Not every activity affects explicit entities.
1815 1816 1817 |
# File 'lib/models/porcelain.rb', line 1815 def entities @entities end |
#id ⇒ Object
Unique identifier of the Activity.
1817 1818 1819 |
# File 'lib/models/porcelain.rb', line 1817 def id @id end |
#ip_address ⇒ Object
The IP from which this action was taken.
1819 1820 1821 |
# File 'lib/models/porcelain.rb', line 1819 def ip_address @ip_address end |
#user_agent ⇒ Object
The User Agent present when this request was executed. Generally a client type and version like strongdm-cli/55.66.77
1822 1823 1824 |
# File 'lib/models/porcelain.rb', line 1822 def user_agent @user_agent end |
#verb ⇒ Object
The kind of activity which has taken place, one of the ActivityVerb constants.
1824 1825 1826 |
# File 'lib/models/porcelain.rb', line 1824 def verb @verb end |
Instance Method Details
#to_json(options = {}) ⇒ Object
1846 1847 1848 1849 1850 1851 1852 |
# File 'lib/models/porcelain.rb', line 1846 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 |