forked from d2iq-archive/marathon
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow multiple health check shields per task id
* Allow multiple health check shields per task id Shield is now identified by /v2/shield/<task_id>/<shield_name> * Renames after live review * Fixed tests * Better error handling in the actor
- Loading branch information
Showing
19 changed files
with
492 additions
and
235 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
docs/docs/rest-api/public/api/v2/examples/health-check-shield-get-single.json
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,5 @@ | ||
{ | ||
"taskId": "incubator_marathon-test-suite_ezhirov_health-check-shield-app.instance-4d0bc714-0fa5-11eb-9138-6ecaa32f70ed._app.1", | ||
"shieldName": "RD-remdbg", | ||
"until": "2020-10-16T12:17:10.856Z" | ||
} |
2 changes: 2 additions & 0 deletions
2
docs/docs/rest-api/public/api/v2/examples/health-check-shield-get.json
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
[ | ||
{ | ||
"taskId": "incubator_marathon-test-suite_ezhirov_health-check-shield-app.instance-4d0bc714-0fa5-11eb-9138-6ecaa32f70ed._app.1", | ||
"shieldName": "RD-remdbg", | ||
"until": "2020-10-16T12:17:10.856Z" | ||
}, | ||
{ | ||
"taskId": "incubator_marathon-test-suite_ezhirov_health-check-shield-app.instance-63450465-0fa5-11eb-9138-6ecaa32f70ed._app.1", | ||
"shieldName": "TA-memdump", | ||
"until": "2020-10-16T12:17:48.184Z" | ||
} | ||
] |
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
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 |
---|---|---|
|
@@ -144,4 +144,5 @@ types: | |
type: object | ||
properties: | ||
taskId: string | ||
shieldName: string | ||
until: string |
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
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
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
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
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
23 changes: 23 additions & 0 deletions
23
src/main/scala/mesosphere/marathon/core/health/HeatlhCheckShieldApi.scala
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,23 @@ | ||
package mesosphere.marathon | ||
package core.health | ||
|
||
import mesosphere.marathon.core.task.Task | ||
import mesosphere.marathon.state.Timestamp | ||
|
||
import scala.concurrent.duration._ | ||
|
||
import scala.concurrent.Future | ||
import akka.{Done} | ||
|
||
trait HealthCheckShieldApi { | ||
// Thread-safe and scalable read path used during health check execution | ||
def isShielded(taskId: Task.Id): Boolean | ||
|
||
// User API surface | ||
def getShields(): Future[Seq[HealthCheckShield]] | ||
def getShields(taskId: Task.Id): Future[Seq[HealthCheckShield]] | ||
def getShield(shieldId: HealthCheckShield.Id): Future[Option[HealthCheckShield]] | ||
|
||
def addOrUpdate(shield: HealthCheckShield): Future[Done] | ||
def remove(shieldId: HealthCheckShield.Id): Future[Done] | ||
} |
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.