package adminapi // The small bodies the endpoints read and answer with. Named types rather // than maps and anonymous structs, so the OpenAPI document generated from // Routes describes exactly what a handler decodes and writes: a map literal // in a handler is a shape no generator can see. // ErrorView is every refusal: a 4xx or 5xx status with what went wrong. type ErrorView struct { Error string `json:"error"` } // Result is what a change that has no other answer says it did. type Result struct { Result string `json:"result"` } // ModelAdded names the model added to the catalog. type ModelAdded struct { Added string `json:"added"` } // Removed names what was taken away: a model, or a quota's scope. type Removed struct { Removed string `json:"removed"` } // ClassRequest sets a model's capacity class: critical, standard or // opportunistic, or empty to go back to what its scaling implies. type ClassRequest struct { Class string `json:"class"` } // ClassView is a model's capacity class now. type ClassView struct { Model string `json:"model"` Class string `json:"class"` } // RetryView says whether the model had been parked, given up on after // failing to start, before it was retried. type RetryView struct { WasParked bool `json:"was_parked"` } // NodeStateRequest cordons, drains or readies a node: ready (or uncordon), // cordoned (or cordon), draining (or drain). type NodeStateRequest struct { State string `json:"state"` } // NodeStateView is a node's state after the change. type NodeStateView struct { ID string `json:"id"` State string `json:"state"` } // NodeRemoved names the node forgotten. Removed is the string "true". type NodeRemoved struct { ID string `json:"id"` Removed string `json:"removed"` } // UpgradeView is the release a node was told to run. type UpgradeView struct { Node string `json:"node"` Version string `json:"version"` } // FabricTestRequest is a bandwidth test between two nodes. type FabricTestRequest struct { A string `json:"a"` B string `json:"b"` // Fabric is the declared fabric to test over; empty is the one the two // nodes share. Fabric string `json:"fabric,omitempty"` // Seconds each rail is measured for, from 1 to 30. Seconds int `json:"seconds,omitempty"` } // ReplayRequest names the model a kept request is sent to again. type ReplayRequest struct { Model string `json:"model"` }