Skip to content

Commit 8ac5e70

Browse files
authored
Merge pull request #400 from Dstack-TEE/open-api-doc
rpc: Add convert doc string in openapi generation
2 parents 2d5df3f + e7ea195 commit 8ac5e70

4 files changed

Lines changed: 223 additions & 38 deletions

File tree

guest-agent/src/rpc_service.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,6 @@ mod tests {
656656
use std::collections::HashSet;
657657
use std::convert::TryFrom;
658658
use std::io::Write;
659-
use tempfile;
660659

661660
fn extract_pubkey_from_report_data(report_data: &[u8], prefix: &str) -> Result<Vec<u8>> {
662661
let end = report_data

guest-api/proto/guest_api.proto

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ import "google/protobuf/empty.proto";
88

99
package guest_api;
1010

11+
// Identifies a running guest worker instance.
1112
message Id {
1213
string id = 1;
1314
}
1415

16+
// Static attestation and registration info reported by the guest agent.
1517
message GuestInfo {
1618
// Guest software version
1719
string version = 1;
@@ -27,11 +29,13 @@ message GuestInfo {
2729
bytes device_id = 6;
2830
}
2931

32+
// IPv4/IPv6 address with prefix length.
3033
message IpAddress {
3134
string address = 1;
3235
uint32 prefix = 2;
3336
}
3437

38+
// Observability metrics for a single NIC inside the guest.
3539
message Interface {
3640
string name = 1;
3741
repeated IpAddress addresses = 2;
@@ -41,21 +45,25 @@ message Interface {
4145
uint64 tx_errors = 6;
4246
}
4347

48+
// Default gateway entry advertised to the guest.
4449
message Gateway {
4550
string address = 1;
4651
}
4752

53+
// Complete networking snapshot including WireGuard info.
4854
message NetworkInformation {
4955
repeated string dns_servers = 1;
5056
repeated Gateway gateways = 2;
5157
repeated Interface interfaces = 3;
5258
string wg_info = 4;
5359
}
5460

61+
// Lists all containers currently scheduled in the guest.
5562
message ListContainersResponse {
5663
repeated Container containers = 1;
5764
}
5865

66+
// Docker-compatible view of an application container.
5967
message Container {
6068
// The ID of this container
6169
string id = 1;
@@ -73,7 +81,7 @@ message Container {
7381
string status = 8;
7482
}
7583

76-
// The system info
84+
// OS, kernel, and resource metrics for the guest worker.
7785
message SystemInfo {
7886
// Operating system
7987
string os_name = 1;
@@ -109,6 +117,7 @@ message SystemInfo {
109117
repeated DiskInfo disks = 17;
110118
}
111119

120+
// Disk usage metrics scoped per device or mount point.
112121
message DiskInfo {
113122
// Device name
114123
string name = 1;
@@ -120,14 +129,21 @@ message DiskInfo {
120129
uint64 free_size = 5;
121130
}
122131

132+
// Direct gRPC surface exposed by the in-guest agent.
123133
service GuestApi {
134+
// Returns attestation material and identifiers for the calling guest.
124135
rpc Info(google.protobuf.Empty) returns (GuestInfo);
136+
// Reports the guest's OS/kernel and resource statistics.
125137
rpc SysInfo(google.protobuf.Empty) returns (SystemInfo);
138+
// Dumps NIC/Gateway configuration so operators can debug connectivity.
126139
rpc NetworkInfo(google.protobuf.Empty) returns (NetworkInformation);
140+
// Enumerates the containers running under the guest supervisor.
127141
rpc ListContainers(google.protobuf.Empty) returns (ListContainersResponse);
142+
// Initiates a graceful shutdown inside the guest VM.
128143
rpc Shutdown(google.protobuf.Empty) returns (google.protobuf.Empty);
129144
}
130145

146+
// Same API surface as GuestApi but multiplexed by VM ID through VMM.
131147
service ProxiedGuestApi {
132148
rpc Info(Id) returns (GuestInfo);
133149
rpc SysInfo(Id) returns (SystemInfo);

0 commit comments

Comments
 (0)