Class: SwarmSDK::RestoreResult
- Inherits:
-
Object
- Object
- SwarmSDK::RestoreResult
- Defined in:
- lib/swarm_sdk/restore_result.rb
Overview
Result object returned from snapshot restore operations
Provides information about the restore process, including any warnings about agents or delegations that couldn't be restored due to configuration mismatches.
Instance Attribute Summary collapse
-
#skipped_agents ⇒ Object
readonly
Returns the value of attribute skipped_agents.
-
#skipped_delegations ⇒ Object
readonly
Returns the value of attribute skipped_delegations.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize(warnings:, skipped_agents:, skipped_delegations:) ⇒ RestoreResult
constructor
Initialize restore result.
-
#partial_restore? ⇒ Boolean
Check if restore was partial (some agents skipped).
-
#success? ⇒ Boolean
Check if restore was completely successful.
-
#summary ⇒ String
Get human-readable summary of restore result.
Constructor Details
#initialize(warnings:, skipped_agents:, skipped_delegations:) ⇒ RestoreResult
Initialize restore result
32 33 34 35 36 |
# File 'lib/swarm_sdk/restore_result.rb', line 32 def initialize(warnings:, skipped_agents:, skipped_delegations:) @warnings = warnings @skipped_agents = skipped_agents @skipped_delegations = skipped_delegations end |
Instance Attribute Details
#skipped_agents ⇒ Object (readonly)
Returns the value of attribute skipped_agents.
25 26 27 |
# File 'lib/swarm_sdk/restore_result.rb', line 25 def skipped_agents @skipped_agents end |
#skipped_delegations ⇒ Object (readonly)
Returns the value of attribute skipped_delegations.
25 26 27 |
# File 'lib/swarm_sdk/restore_result.rb', line 25 def skipped_delegations @skipped_delegations end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
25 26 27 |
# File 'lib/swarm_sdk/restore_result.rb', line 25 def warnings @warnings end |
Instance Method Details
#partial_restore? ⇒ Boolean
Check if restore was partial (some agents skipped)
48 49 50 |
# File 'lib/swarm_sdk/restore_result.rb', line 48 def partial_restore? !warnings.empty? end |
#success? ⇒ Boolean
Check if restore was completely successful
41 42 43 |
# File 'lib/swarm_sdk/restore_result.rb', line 41 def success? warnings.empty? end |
#summary ⇒ String
Get human-readable summary of restore result
55 56 57 58 59 60 61 62 63 |
# File 'lib/swarm_sdk/restore_result.rb', line 55 def summary if success? "Snapshot restored successfully. All agents restored." else "Snapshot restored with warnings. " \ "#{skipped_agents.size} agents skipped, " \ "#{skipped_delegations.size} delegation instances skipped." end end |