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