Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ Shown above are uses for both `orchestrator-client` and the `orchestrator` comma
```shell
$ curl -s "http://my.orchestrator.service:80/api/begin-downtime/my.hostname/3306/wallace/experimenting+failover/45m"
```
`45m` is duration of time in minutes the host will be marked under downtime.
If we don't mention the time, it would consider `config.MaintenanceExpireMinutes` time as downtime which is default 10m

The `orchestrator-client` script runs this very API call, wrapping it up and encoding the URL path. It can also automatically detect the leader, in case you don't want to run through a proxy.

Expand Down
5 changes: 5 additions & 0 deletions go/inst/downtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ package inst

import (
"time"
"github.com/openark/orchestrator/go/config"
)


type Downtime struct {
Key *InstanceKey
Owner string
Expand All @@ -32,6 +34,9 @@ type Downtime struct {
}

func NewDowntime(instanceKey *InstanceKey, owner string, reason string, duration time.Duration) *Downtime {
if duration == 0 {
duration = config.MaintenanceExpireMinutes * time.Minute
}
downtime := &Downtime{
Key: instanceKey,
Owner: owner,
Expand Down