blob: e5529f9365b3075d1e5f7b35b1186e2b7991af81 [file] [log] [blame]
Serge Bazanskiefdb6e92020-07-13 17:19:27 +02001// 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
17syntax = "proto3";
Serge Bazanski662b5b32020-12-21 13:49:00 +010018package metropolis.proto.api;
Serge Bazanski31370b02021-01-07 16:31:14 +010019option go_package = "source.monogon.dev/metropolis/proto/api";
Serge Bazanskiefdb6e92020-07-13 17:19:27 +020020
Serge Bazanskib91938f2023-03-29 14:31:22 +020021import "metropolis/proto/api/management.proto";
Mateusz Zalegacf92f402022-07-08 15:08:48 +020022
Serge Bazanski662b5b32020-12-21 13:49:00 +010023// NodeDebugService exposes debug and testing endpoints that allow introspection into a running Metropolis node.
Serge Bazanski77cb6c52020-12-19 00:09:22 +010024// It is not authenticated and will be disabled in production. It is currently consumed by metropolis/cli/dbg and
25// by tests.
Serge Bazanskiefdb6e92020-07-13 17:19:27 +020026service NodeDebugService {
27 // GetDebugKubeconfig issues kubeconfigs with arbitrary identities and groups for debugging
28 rpc GetDebugKubeconfig(GetDebugKubeconfigRequest) returns (GetDebugKubeconfigResponse);
Serge Bazanskib0272182020-11-02 18:39:44 +010029
Serge Bazanskida114862023-03-29 17:46:42 +020030 // A reimplementation of metropolis.api.NodeManagement.Logs that's available
31 // before the node starts up the management service.
Serge Bazanskib0272182020-11-02 18:39:44 +010032 rpc GetLogs(GetLogsRequest) returns (stream GetLogsResponse);
Lorenz Brun09c275b2021-03-30 12:47:09 +020033
34 // Trace enables tracing of Metropolis using the Linux ftrace infrastructure.
35 rpc Trace(TraceRequest) returns (stream TraceEvent);
Lorenz Brun9d6c4c72021-07-20 21:16:27 +020036
37 // LoadImage loads an uncompressed tarball containing a Docker v1.1, v1.2 or OCI v1 image into the local
38 // containerd image store. The client streams the tarball in arbitrary-sized chunks and closes the sending side
39 // once it has sent the entire image. The server then either returns an empty response if successful or a gRPC error.
40 rpc LoadImage(stream ImagePart) returns (LoadImageResponse);
Serge Bazanskiefdb6e92020-07-13 17:19:27 +020041}
42
Lorenz Brun9d6c4c72021-07-20 21:16:27 +020043message ImagePart {
44 bytes data_part = 1;
45}
46
47message LoadImageResponse {
48}
Serge Bazanskiefdb6e92020-07-13 17:19:27 +020049
50message GetDebugKubeconfigRequest {
51 string id = 1; // Kubernetes identity (user)
52 repeated string groups = 2; // Kubernetes groups
53}
54
55message GetDebugKubeconfigResponse {
56 string debug_kubeconfig = 1;
57}
58
Lorenz Brun09c275b2021-03-30 12:47:09 +020059message TraceRequest {
60 // Name of the tracer to use. Defined in https://www.kernel.org/doc/html/latest/trace/ftrace.html#the-tracers.
61 // Useful ones enabled in Metropolis: function_graph, function.
62 // Gets reset to nop automatically after the stream is terminated.
63 string tracer = 1;
64
65 // List of functions to trace. Accepts wildcards using the '*' character. If left empty traces all functions.
66 repeated string function_filter = 2;
67
68 // List of functions and their descendants to trace with the function_graph tracer.
69 repeated string graph_function_filter = 3;
70}
71
72message TraceEvent {
73 // Currently we do not parse the event data and just return what the kernel outputs, line-by-line.
74 string raw_line = 1;
Mateusz Zalegacf92f402022-07-08 15:08:48 +020075}