deploy.proto 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. syntax = "proto3";
  2. // protoc --version=libprotoc 3.11.3
  3. // protoc-gen-go --version=v1.3.5
  4. // protoc --go_out=plugins=grpc:. pkg/hostman/hostdeployer/apis/deploy.proto
  5. package apis;
  6. option go_package = "yunion.io/x/onecloud/pkg/hostman/hostdeployer/apis";
  7. message GuestDesc {
  8. string name = 1;
  9. string uuid = 2;
  10. string domain = 3;
  11. repeated Nic nics = 4;
  12. repeated Nic nics_standby = 5;
  13. repeated Disk disks = 6;
  14. string Hypervisor = 7;
  15. string hostname = 8;
  16. }
  17. message Disk {
  18. string disk_id = 1;
  19. string driver = 2;
  20. string cache_mode = 3;
  21. string aio_mode = 4;
  22. int64 size = 5;
  23. string template_id = 6;
  24. string image_path = 7;
  25. string storage_id = 8;
  26. bool migrating = 9;
  27. string target_storage_id = 10;
  28. string path = 11;
  29. string format = 12;
  30. int32 index = 13;
  31. bool merge_snapshot = 14;
  32. string fs = 15;
  33. string mountpoint = 16;
  34. string dev = 17;
  35. }
  36. message Nic {
  37. string mac = 1;
  38. string ip = 2;
  39. string net = 3;
  40. string net_id = 4;
  41. bool virtual = 5;
  42. string gateway = 6;
  43. string dns = 7;
  44. string domain = 8;
  45. string routes = 9;
  46. string ifname = 10;
  47. int32 masklen = 11;
  48. string driver = 12;
  49. string bridge = 13;
  50. string wire_id = 14;
  51. int32 vlan = 15;
  52. string interface = 16;
  53. int32 bw = 17;
  54. int32 index = 18;
  55. repeated string virtual_ips = 19;
  56. string externel_id = 20;
  57. string team_with = 21;
  58. bool manual = 22;
  59. string nic_type = 23;
  60. bool link_up = 24;
  61. int64 mtu = 25;
  62. string name = 26;
  63. bool is_default = 27;
  64. string ip6 = 28;
  65. int32 masklen6 = 29;
  66. string gateway6 = 30;
  67. }
  68. message VDDKConInfo {
  69. string host = 1;
  70. int32 port = 2;
  71. string user = 3;
  72. string passwd = 4;
  73. string vmref = 5;
  74. }
  75. message DeployInfo {
  76. SSHKeys public_key = 1;
  77. repeated DeployContent deploys = 2;
  78. string password = 3;
  79. bool is_random_password =4;
  80. bool is_init = 5;
  81. bool enable_tty = 6;
  82. bool default_root_user = 7;
  83. bool windows_default_admin_user = 8;
  84. bool enable_cloud_init = 9;
  85. string login_account = 10;
  86. Telegraf telegraf = 11;
  87. string user_data = 12;
  88. }
  89. message Telegraf {
  90. string telegraf_conf = 1;
  91. }
  92. message SSHKeys {
  93. string public_key = 1;
  94. string delete_public_key = 2;
  95. string admin_public_key = 3;
  96. string project_public_key = 4;
  97. }
  98. message DeployContent {
  99. string path = 1;
  100. string content = 2;
  101. string action = 3;
  102. }
  103. message Empty {
  104. }
  105. message DeployGuestFsResponse {
  106. string distro = 1;
  107. string version = 2;
  108. string arch = 3;
  109. string language = 4;
  110. string os = 5;
  111. string account = 6;
  112. string key = 7;
  113. bool telegraf_deployed = 8;
  114. string current_version = 9;
  115. }
  116. message DiskInfo {
  117. string path = 1;
  118. string encrypt_password = 2;
  119. string encrypt_format = 3;
  120. string encrypt_alg = 4;
  121. string disk_id = 5;
  122. }
  123. message DeployParams {
  124. DiskInfo disk_info = 1;
  125. GuestDesc guest_desc = 2;
  126. DeployInfo deploy_info = 3;
  127. VDDKConInfo vddk_info = 4;
  128. }
  129. message ResizeFsParams {
  130. DiskInfo disk_info = 1;
  131. string hypervisor = 2;
  132. VDDKConInfo vddk_info = 3;
  133. GuestDesc guest_desc = 4;
  134. }
  135. message FsExt4Features {
  136. bool CaseInsensitive = 1;
  137. int32 ReservedBlocksPercentage = 2;
  138. }
  139. message FsF2fsFeatures {
  140. bool CaseInsensitive = 1;
  141. int32 OverprovisionRatioPercentage = 2;
  142. }
  143. message FsFeatures {
  144. FsExt4Features ext4 = 1;
  145. FsF2fsFeatures f2fs = 2;
  146. }
  147. message FormatFsParams {
  148. DiskInfo disk_info = 1;
  149. string fs_format = 2;
  150. string uuid = 3;
  151. FsFeatures fs_features = 4;
  152. }
  153. message ReleaseInfo {
  154. string distro = 1;
  155. string version = 2;
  156. string arch = 3;
  157. string language = 4;
  158. string current_version = 5;
  159. }
  160. message SaveToGlanceParams {
  161. DiskInfo disk_info = 1;
  162. bool compress = 2;
  163. }
  164. message SaveToGlanceResponse {
  165. string os_info = 1;
  166. ReleaseInfo release_info = 2;
  167. }
  168. message ProbeImageInfoPramas {
  169. DiskInfo disk_info = 1;
  170. }
  171. message ImageInfo {
  172. ReleaseInfo os_info = 1;
  173. string os_type = 2;
  174. bool is_uefi_support = 3;
  175. bool is_lvm_partition = 4;
  176. bool is_readonly = 5;
  177. string physical_partition_type = 6;
  178. bool is_installed_cloud_init = 7;
  179. bool is_bios_support = 8;
  180. }
  181. message EsxiDiskInfo {
  182. string disk_path = 1;
  183. }
  184. message ConnectEsxiDisksParams {
  185. VDDKConInfo vddk_info = 1;
  186. repeated EsxiDiskInfo access_info = 2;
  187. }
  188. message EsxiDisksConnectionInfo {
  189. repeated EsxiDiskInfo disks = 1;
  190. }
  191. // cdrom, scsi cdrom, hard drive, scsi, pci
  192. message BootDevices {
  193. int32 BootOrder = 1;
  194. int32 DevType = 2;
  195. int32 AttachOrder = 3;
  196. }
  197. message OvmfBootOrderParams {
  198. string OvmfVarsPath = 1;
  199. repeated BootDevices devs = 2;
  200. }
  201. service DeployAgent {
  202. rpc DeployGuestFs (DeployParams) returns (DeployGuestFsResponse);
  203. rpc ResizeFs (ResizeFsParams) returns (Empty);
  204. rpc FormatFs (FormatFsParams) returns (Empty);
  205. rpc SaveToGlance (SaveToGlanceParams) returns (SaveToGlanceResponse);
  206. rpc ProbeImageInfo(ProbeImageInfoPramas) returns (ImageInfo);
  207. rpc ConnectEsxiDisks(ConnectEsxiDisksParams) returns (EsxiDisksConnectionInfo);
  208. rpc DisconnectEsxiDisks(EsxiDisksConnectionInfo) returns (Empty);
  209. rpc SetOvmfBootOrder(OvmfBootOrderParams) returns (Empty);
  210. }