-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to mark instances as absent (#1731)
* Mark hosts as absent on backend * Revert changes to cluster * Add tests and rework implementation * Abstract repeated code into a private helper function * Reordering tests * Move test for initial conditions into pre-existing tests * Separate database/application instance tests * Refactor `update_instance()` to use pattern-matching * Revert formatting * Use namespaced `Kernel.struct()` * Renaming * Remove `SapSystem` namespace * Remove redundant initialisation of default fields * Renaming
- Loading branch information
1 parent
f574b4a
commit 8a4da21
Showing
12 changed files
with
689 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
lib/trento/domain/sap_system/commands/mark_application_instance_absent.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
defmodule Trento.Domain.Commands.MarkApplicationInstanceAbsent do | ||
@moduledoc """ | ||
Mark an application instance as absent | ||
""" | ||
@required_fields :all | ||
|
||
use Trento.Command | ||
|
||
defcommand do | ||
field :instance_number, :string | ||
field :host_id, Ecto.UUID | ||
field :sap_system_id, Ecto.UUID | ||
field :absent_at, :utc_datetime_usec | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
lib/trento/domain/sap_system/commands/mark_database_instance_absent.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
defmodule Trento.Domain.Commands.MarkDatabaseInstanceAbsent do | ||
@moduledoc """ | ||
Mark a database instance as absent | ||
""" | ||
@required_fields :all | ||
|
||
use Trento.Command | ||
|
||
defcommand do | ||
field :instance_number, :string | ||
field :host_id, Ecto.UUID | ||
field :sap_system_id, Ecto.UUID | ||
field :absent_at, :utc_datetime_usec | ||
end | ||
end |
14 changes: 14 additions & 0 deletions
14
lib/trento/domain/sap_system/events/application_instance_marked_absent.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
defmodule Trento.Domain.Events.ApplicationInstanceMarkedAbsent do | ||
@moduledoc """ | ||
This event is emitted when an application instance is marked as absent from the SAP system. | ||
""" | ||
|
||
use Trento.Event | ||
|
||
defevent do | ||
field :instance_number, :string | ||
field :host_id, Ecto.UUID | ||
field :sap_system_id, Ecto.UUID | ||
field :absent_at, :utc_datetime_usec | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
lib/trento/domain/sap_system/events/application_instance_marked_present.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
defmodule Trento.Domain.Events.ApplicationInstanceMarkedPresent do | ||
@moduledoc """ | ||
This event is emitted when an application instance is marked as present in the SAP system. | ||
""" | ||
|
||
use Trento.Event | ||
|
||
defevent do | ||
field :instance_number, :string | ||
field :host_id, Ecto.UUID | ||
field :sap_system_id, Ecto.UUID | ||
end | ||
end |
14 changes: 14 additions & 0 deletions
14
lib/trento/domain/sap_system/events/database_instance_marked_absent.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
defmodule Trento.Domain.Events.DatabaseInstanceMarkedAbsent do | ||
@moduledoc """ | ||
This event is emitted when a database instance is marked as absent from the SAP system. | ||
""" | ||
|
||
use Trento.Event | ||
|
||
defevent do | ||
field :instance_number, :string | ||
field :host_id, Ecto.UUID | ||
field :sap_system_id, Ecto.UUID | ||
field :absent_at, :utc_datetime_usec | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
lib/trento/domain/sap_system/events/database_instance_marked_present.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
defmodule Trento.Domain.Events.DatabaseInstanceMarkedPresent do | ||
@moduledoc """ | ||
This event is emitted when a database instance is marked as present in the SAP system. | ||
""" | ||
|
||
use Trento.Event | ||
|
||
defevent do | ||
field :instance_number, :string | ||
field :host_id, Ecto.UUID | ||
field :sap_system_id, Ecto.UUID | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.