Serge Bazanski | efdb6e9 | 2020-07-13 17:19:27 +0200 | [diff] [blame^] | 1 | // Copyright 2020 The Monogon Project Authors. |
| 2 | // |
| 3 | // SPDX-License-Identifier: Apache-2.0 |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | // you may not use this file except in compliance with the License. |
| 7 | // You may obtain a copy of the License at |
| 8 | // |
| 9 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | // |
| 11 | // Unless required by applicable law or agreed to in writing, software |
| 12 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | // See the License for the specific language governing permissions and |
| 15 | // limitations under the License. |
| 16 | |
| 17 | syntax = "proto3"; |
| 18 | package smalltown.core.proto.api; |
| 19 | option go_package = "git.monogon.dev/source/nexantic.git/core/proto/api"; |
| 20 | |
| 21 | import "core/proto/api/enrolment.proto"; |
| 22 | |
| 23 | // NodeDebugService exposes debug and testing endpoints that allow introspection into a running Smalltown instance. |
| 24 | // It is not authenticated and will be disabled in production. It is currently consumed by core/cmd/dbg and |
| 25 | // by tests. For exact documentation of the available parameters please look at core/internal/node/debug.go. |
| 26 | service NodeDebugService { |
| 27 | // GetDebugKubeconfig issues kubeconfigs with arbitrary identities and groups for debugging |
| 28 | rpc GetDebugKubeconfig(GetDebugKubeconfigRequest) returns (GetDebugKubeconfigResponse); |
| 29 | // GetComponentLogs dumps various log ringbuffers for binaries that we run. |
| 30 | rpc GetComponentLogs(GetComponentLogsRequest) returns (GetComponentLogsResponse); |
| 31 | // GetCondition gives the current status of various conditions inside Smalltown. Mainly used for testing. |
| 32 | rpc GetCondition(GetConditionRequest) returns (GetConditionResponse); |
| 33 | } |
| 34 | |
| 35 | |
| 36 | message GetDebugKubeconfigRequest { |
| 37 | string id = 1; // Kubernetes identity (user) |
| 38 | repeated string groups = 2; // Kubernetes groups |
| 39 | } |
| 40 | |
| 41 | message GetDebugKubeconfigResponse { |
| 42 | string debug_kubeconfig = 1; |
| 43 | } |
| 44 | |
| 45 | message GetComponentLogsRequest { |
| 46 | // For supported paths see core/internal/node/debug.go |
| 47 | repeated string component_path = 1; |
| 48 | uint32 tail_lines = 2; // 0 = whole ring buffer |
| 49 | } |
| 50 | |
| 51 | message GetComponentLogsResponse { |
| 52 | repeated string line = 1; |
| 53 | } |
| 54 | |
| 55 | message GetConditionRequest { |
| 56 | string name = 1; |
| 57 | } |
| 58 | |
| 59 | message GetConditionResponse { |
| 60 | bool ok = 1; |
| 61 | } |