-
Notifications
You must be signed in to change notification settings - Fork 132
/
hardware.proto
229 lines (206 loc) · 4.7 KB
/
hardware.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
syntax = "proto3";
option go_package = "hardware";
package github.com.tinkerbell.tink.protos.hardware;
import "google/api/annotations.proto";
service HardwareService {
rpc Push (PushRequest) returns (Empty) {
option (google.api.http) = {
post: "/v1/hardware"
body: "*"
};
};
rpc ByMAC(GetRequest) returns (Hardware) {
option (google.api.http) = {
post: "/v1/hardware/mac"
body: "*"
};
};
rpc ByIP(GetRequest) returns (Hardware) {
option (google.api.http) = {
post: "/v1/hardware/ip"
body: "*"
};
};
rpc ByID(GetRequest) returns (Hardware) {
option (google.api.http) = {
get: "/v1/hardware/{id}"
};
};
rpc All(Empty) returns (stream Hardware) {
option (google.api.http) = {
get: "/v1/hardware"
};
};
rpc Watch(GetRequest) returns (stream Hardware);
rpc Delete(DeleteRequest) returns (Empty);
}
message PushRequest {
Hardware data = 1;
}
message Empty {
}
message GetRequest {
string mac = 1;
string ip = 2;
string id = 3;
}
message Hardware {
message DHCP {
message IP {
string address = 1;
string netmask = 2;
string gateway = 3;
int64 family = 4;
}
string mac = 1;
string OBSOLETE_ip = 2; // obsolete
string hostname = 3;
int64 lease_time = 4;
repeated string name_servers = 5;
repeated string time_servers = 6;
string OBSOLETE_gateway = 7; // obsolete
string arch = 8;
bool uefi = 9;
string iface_name = 10;
IP ip = 11;
}
message Netboot {
message IPXE {
string url = 1;
string contents = 2;
}
message Bootstrapper { // obsolete
}
message Osie {
string base_url = 1;
string kernel = 2;
string initrd = 3;
}
bool allow_pxe = 1;
bool allow_workflow = 2;
IPXE ipxe = 3;
Bootstrapper OBSOLETE_bootstrapper = 4; // obsolete
Osie osie = 5;
}
message Network {
message Interface {
DHCP dhcp = 1;
Netboot netboot = 2;
}
DHCP OBSOLETE_dhcp = 1; // obsolete
Netboot OBSOLETE_netboot = 2; // obsolete
repeated Interface interfaces = 3;
Interface OBSOLETE_default = 4; // obsolete
}
message Metadata {
message Manufacturer {
string id = 1;
string slug = 2;
}
message Instance {
message OperatingSystem {
string slug = 1;
string distro = 2;
string version = 3;
string image_tag = 4;
string os_slug = 5;
}
message IP {
string address = 1;
string netmask = 2;
string gateway = 3;
int64 family = 4;
bool public = 5;
bool management = 6;
}
message Storage {
message Disk {
message Partition {
string label = 1;
int64 number = 2;
int64 size = 3;
int64 start = 4;
string type_guid = 5;
}
string device = 1;
bool wipe_table = 2;
repeated Partition partitions = 3;
}
message File {
string path = 1;
string contents = 2;
int64 mode = 3;
int64 uid = 4;
int64 gid = 5;
}
message Mount {
message FilesystemOptions {
bool force = 1;
repeated string options = 2;
}
string device = 1;
string format = 2;
repeated File files = 3;
FilesystemOptions create = 4;
string point = 5;
}
message Filesystem {
Mount mount = 1;
}
message RAID {
string name = 1;
string level = 2;
repeated string devices = 3;
int64 spare = 4;
}
repeated string OBSOLETE_disks = 1; // obsolete
repeated string OBSOLETE_raid = 2; // obsolete
repeated string OBSOLETE_filesystems = 3; // obsolete
repeated Disk disks = 4;
repeated RAID raid = 5;
repeated Filesystem filesystems = 6;
}
string id = 1;
string state = 2;
string hostname = 3;
bool allow_pxe = 4;
bool rescue = 5;
OperatingSystem operating_system_version = 6;
bool always_pxe = 7;
string ipxe_script_url = 8;
repeated IP ips = 9;
string userdata = 10;
string crypted_root_password = 11;
repeated string tags = 12;
Storage storage = 13;
repeated string ssh_keys = 14;
bool network_ready = 15;
}
message Custom {
Instance.OperatingSystem preinstalled_operating_system_version = 1;
repeated string private_subnets = 2;
}
message Facility {
string plan_slug = 1;
string plan_version_slug = 2;
string facility_code = 3;
}
string state = 1;
int64 bonding_mode = 2;
Manufacturer manufacturer = 3;
Instance instance = 4;
Custom custom = 5;
Facility facility = 6;
}
string OBSOLETE_JSON = 1; // obsolete
DHCP OBSOLETE_dhcp = 2; // obsolete
Netboot OBSOLETE_netboot = 3; //obsolete
repeated Network OBSOLETE_network = 4; // obsolete
Metadata metadata = 5;
Network network = 6;
string id = 7;
int64 version = 8;
}
message DeleteRequest {
string ID = 1;
}