| 1 |
// |
| 2 |
// Licensed to the Apache Software Foundation (ASF) under one |
| 3 |
// or more contributor license agreements. See the NOTICE file |
| 4 |
// distributed with this work for additional information |
| 5 |
// regarding copyright ownership. The ASF licenses this file |
| 6 |
// to you under the Apache License, Version 2.0 (the |
| 7 |
// "License"); you may not use this file except in compliance |
| 8 |
// with the License. You may obtain a copy of the License at |
| 9 |
// |
| 10 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 11 |
// |
| 12 |
// Unless required by applicable law or agreed to in writing, software |
| 13 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 14 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 |
// See the License for the specific language governing permissions and |
| 16 |
// limitations under the License. |
| 17 |
|
| 18 |
syntax = "proto2"; |
| 19 |
|
| 20 |
package mesos.maintenance; |
| 21 |
|
| 22 |
import "github.com/mesos/mesos-go/api/v1/lib/mesos.proto"; |
| 23 |
import "github.com/mesos/mesos-go/api/v1/lib/allocator/allocator.proto"; |
| 24 |
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; |
| 25 |
|
| 26 |
option go_package = "maintenance"; |
| 27 |
option (gogoproto.benchgen_all) = true; |
| 28 |
option (gogoproto.enum_stringer_all) = true; |
| 29 |
option (gogoproto.equal_all) = true; |
| 30 |
option (gogoproto.goproto_enum_prefix_all) = false; |
| 31 |
option (gogoproto.goproto_enum_stringer_all) = false; |
| 32 |
option (gogoproto.goproto_stringer_all) = false; |
| 33 |
option (gogoproto.goproto_unrecognized_all) = false; |
| 34 |
option (gogoproto.gostring_all) = true; |
| 35 |
option (gogoproto.marshaler_all) = true; |
| 36 |
option (gogoproto.populate_all) = true; |
| 37 |
option (gogoproto.protosizer_all) = true; |
| 38 |
option (gogoproto.stringer_all) = true; |
| 39 |
option (gogoproto.testgen_all) = true; |
| 40 |
option (gogoproto.unmarshaler_all) = true; |
| 41 |
option (gogoproto.verbose_equal_all) = true; |
| 42 |
|
| 43 |
// This is an illustration of a maintenance `Schedule`: |
| 44 |
// |
| 45 |
// This is a `Window`. |
| 46 |
// Machine ^ | |
| 47 |
// ... | v |
| 48 |
// 12 | +----------------+ |
| 49 |
// 11 | | | |
| 50 |
// 10 | +----------------+ |
| 51 |
// 9 | +----------------+ |
| 52 |
// 8 | | | |
| 53 |
// 7 | +----------------+ |
| 54 |
// 6 | +----------------+ |
| 55 |
// 5 | | | |
| 56 |
// 4 | +----------------+ |
| 57 |
// 3 | +-----------+ |
| 58 |
// 2 | | | |
| 59 |
// 1 | +-----------+ |
| 60 |
// | |
| 61 |
// +-----------------------------------------------------~~~~-> |
| 62 |
// Downtime for maintenance |
| 63 |
|
| 64 |
|
| 65 |
/** |
| 66 |
* A set of machines scheduled to go into maintenance |
| 67 |
* in the same `unavailability`. |
| 68 |
*/ |
| 69 |
message Window { |
| 70 |
// Machines affected by this maintenance window. |
| 71 |
repeated MachineID machine_ids = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "MachineIDs"]; |
| 72 |
|
| 73 |
// Interval during which this set of machines is expected to be down. |
| 74 |
required Unavailability unavailability = 2 [(gogoproto.nullable) = false]; |
| 75 |
} |
| 76 |
|
| 77 |
|
| 78 |
/** |
| 79 |
* A list of maintenance windows. |
| 80 |
* For example, this may represent a rolling restart of agents. |
| 81 |
*/ |
| 82 |
message Schedule { |
| 83 |
repeated Window windows = 1 [(gogoproto.nullable) = false]; |
| 84 |
} |
| 85 |
|
| 86 |
|
| 87 |
/** |
| 88 |
* Represents the maintenance status of each machine in the cluster. |
| 89 |
* The lists correspond to the `MachineInfo.Mode` enumeration. |
| 90 |
*/ |
| 91 |
message ClusterStatus { |
| 92 |
message DrainingMachine { |
| 93 |
required MachineID id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "ID"]; |
| 94 |
|
| 95 |
// A list of the most recent responses to inverse offers from frameworks |
| 96 |
// running on this draining machine. |
| 97 |
repeated allocator.InverseOfferStatus statuses = 2 [(gogoproto.nullable) = false]; |
| 98 |
} |
| 99 |
|
| 100 |
repeated DrainingMachine draining_machines = 1 [(gogoproto.nullable) = false]; |
| 101 |
repeated MachineID down_machines = 2 [(gogoproto.nullable) = false]; |
| 102 |
} |