host.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package compute
  15. import (
  16. "time"
  17. cloudmux "yunion.io/x/cloudmux/pkg/apis/compute"
  18. "yunion.io/x/jsonutils"
  19. "yunion.io/x/onecloud/pkg/apis"
  20. billing_api "yunion.io/x/onecloud/pkg/apis/billing"
  21. "yunion.io/x/onecloud/pkg/cloudcommon/types"
  22. )
  23. type HostSpec struct {
  24. apis.Meta
  25. Cpu int `json:"cpu"`
  26. Mem int `json:"mem"`
  27. NicCount int `json:"nic_count"`
  28. Manufacture string `json:"manufacture"`
  29. Model string `json:"model"`
  30. Disk DiskDriverSpec `json:"disk"`
  31. Driver string `json:"driver"`
  32. IsolatedDevices []IsolatedDeviceSpec `json:"isolated_devices"`
  33. }
  34. type IsolatedDeviceSpec struct {
  35. apis.Meta
  36. DevType string `json:"dev_type"`
  37. Model string `json:"model"`
  38. PciId string `json:"pci_id"`
  39. Vendor string `json:"vendor"`
  40. }
  41. type DiskDriverSpec map[string]DiskAdapterSpec
  42. type DiskAdapterSpec map[string][]*DiskSpec
  43. type DiskSpec struct {
  44. apis.Meta
  45. Type string `json:"type"`
  46. Size int64 `json:"size"`
  47. StartIndex int `json:"start_index"`
  48. EndIndex int `json:"end_index"`
  49. Count int `json:"count"`
  50. }
  51. type HostListInput struct {
  52. apis.EnabledStatusInfrasResourceBaseListInput
  53. apis.ExternalizedResourceBaseListInput
  54. ManagedResourceListInput
  55. ZonalFilterListInput
  56. WireFilterListInput
  57. SchedtagFilterListInput
  58. StorageFilterListInput
  59. UsableResourceListInput
  60. BackupstorageFilterListInput
  61. // filter by ResourceType
  62. ResourceType string `json:"resource_type"`
  63. // filter by mac of any network interface
  64. AnyMac string `json:"any_mac"`
  65. // filter by ip of any network interface
  66. AnyIp []string `json:"any_ip"`
  67. // filter storages not attached to this host
  68. StorageNotAttached *bool `json:"storage_not_attached"`
  69. // filter by Hypervisor
  70. Hypervisor string `json:"hypervisor"`
  71. // filter host that is empty
  72. IsEmpty *bool `json:"is_empty"`
  73. // filter host that is baremetal
  74. Baremetal *bool `json:"baremetal"`
  75. // 机架
  76. Rack []string `json:"rack"`
  77. // 机位
  78. Slots []string `json:"slots"`
  79. // 管理口MAC
  80. AccessMac []string `json:"access_mac"`
  81. // 管理口Ip地址
  82. AccessIp []string `json:"access_ip"`
  83. // 公网IP地址
  84. PublicIp []string `json:"public_ip"`
  85. // 物理机序列号信息
  86. SN []string `json:"sn"`
  87. // CPU大小
  88. CpuCount []int `json:"cpu_count"`
  89. // 内存大小,单位Mb
  90. MemSize []int `json:"mem_size"`
  91. // 存储类型(磁盘类型,sdd, rotate, hybrid)
  92. StorageType []string `json:"storage_type"`
  93. // 宿主机绑定存储类型
  94. HostStorageType []string `json:"host_storage_type"`
  95. // IPMI地址
  96. IpmiIp []string `json:"ipmi_ip"`
  97. // 宿主机状态
  98. // example: online
  99. HostStatus []string `json:"host_status"`
  100. // 宿主机类型
  101. HostType []string `json:"host_type"`
  102. // host服务软件版本
  103. Version []string `json:"version"`
  104. // OVN软件版本
  105. OvnVersion []string `json:"ovn_version"`
  106. // 是否处于维护状态
  107. IsMaintenance *bool `json:"is_maintenance"`
  108. // 是否为导入的宿主机
  109. IsImport *bool `json:"is_import"`
  110. // 是否允许PXE启动
  111. EnablePxeBoot *bool `json:"enable_pxe_boot"`
  112. // 主机UUID
  113. Uuid []string `json:"uuid"`
  114. // 主机启动模式, 可能值位PXE和ISO
  115. BootMode []string `json:"boot_mode"`
  116. // 虚拟机所在的二层网络
  117. ServerIdForNetwork string `json:"server_id_for_network"`
  118. // 宿主机 cpu 架构
  119. CpuArchitecture []string `json:"cpu_architecture"`
  120. OsArch []string `json:"os_arch"`
  121. // 按虚拟机数量排序
  122. // enum: ["asc","desc"]
  123. OrderByServerCount string `json:"order_by_server_count"`
  124. // 按存储大小排序
  125. // enmu: asc,desc
  126. OrderByStorage string `json:"order_by_storage"`
  127. // 按存储超分率排序
  128. // enmu: asc,desc
  129. OrderByStorageCommitRate string `json:"order_by_storage_commit_rate"`
  130. // 按cpu超分率排序
  131. // enmu: asc,desc
  132. OrderByCpuCommitRate string `json:"order_by_cpu_commit_rate"`
  133. // 按内存超分率排序
  134. // enmu: asc,desc
  135. OrderByMemCommitRate string `json:"order_by_mem_commit_rate"`
  136. // 按本地存储分配大小排序
  137. // enmu: asc,desc
  138. OrderByStorageUsed string `json:"order_by_storage_used"`
  139. // 按cpu分配大小排序
  140. // enmu: asc,desc
  141. OrderByCpuCommit string `json:"order_by_cpu_commit"`
  142. // 按内存分配大小排序
  143. // enmu: asc,desc
  144. OrderByMemCommit string `json:"order_by_mem_commit"`
  145. // 按物理cpu使用率排序
  146. // enmu: asc,desc
  147. OrderByCpuUsage string `json:"order_by_cpu_usage"`
  148. // 按物理内存使用率排序
  149. // enmu: asc,desc
  150. OrderByMemUsage string `json:"order_by_mem_usage"`
  151. // 按物理存储使用率排序
  152. // enmu: asc,desc
  153. OrderByStorageUsage string `json:"order_by_storage_usage"`
  154. // 按虚拟内存使用率排序
  155. // enmu: asc,desc
  156. OrderByVirtualMemUsage string `json:"order_by_virtual_mem_usage"`
  157. // 按虚拟cpu使用率排序
  158. // enmu: asc,desc
  159. OrderByVirtualCpuUsage string `json:"order_by_virtual_cpu_usage"`
  160. // 按虚拟存储使用率排序
  161. // enmu: asc,desc
  162. OrderByVirtualStorageUsage string `json:"order_by_virtual_storage_usage"`
  163. }
  164. type HostDetails struct {
  165. apis.EnabledStatusInfrasResourceBaseDetails
  166. ManagedResourceInfo
  167. ZoneResourceInfo
  168. SHost
  169. Schedtags []SchedtagShortDescDetails `json:"schedtags"`
  170. ServerId string `json:"server_id"`
  171. Server string `json:"server"`
  172. ServerIps string `json:"server_ips"`
  173. ServerPendingDeleted bool `json:"server_pending_deleted"`
  174. // 网卡数量
  175. NicCount int `json:"nic_count"`
  176. // 网卡详情
  177. NicInfo []*types.SNic `json:"nic_info"`
  178. // CPU超分比
  179. CpuCommit int `json:"cpu_commit"`
  180. // 内存超分比
  181. MemCommit int `json:"mem_commit"`
  182. // 云主机数量
  183. // example: 10
  184. Guests int `json:"guests,allowempty"`
  185. // 主备云主机数量
  186. // example: 10
  187. BackupGuests int `json:"backup_guests,allowempty"`
  188. // 非系统云主机数量
  189. // example: 0
  190. NonsystemGuests int `json:"nonsystem_guests,allowempty"`
  191. // 运行状态云主机数量
  192. // example: 2
  193. RunningGuests int `json:"running_guests,allowempty"`
  194. // 关机状态云主机数量
  195. // example: 2
  196. ReadyGuests int `json:"ready_guests,allowempty"`
  197. // 其他状态云主机数量
  198. // example: 2
  199. OtherGuests int `json:"other_guests,allowempty"`
  200. // 回收站中云主机数量
  201. // example: 2
  202. PendingDeletedGuests int `json:"pending_deleted_guests,allowempty"`
  203. // CPU超分率
  204. CpuCommitRate float64 `json:"cpu_commit_rate"`
  205. // 内存超分率
  206. MemCommitRate float64 `json:"mem_commit_rate"`
  207. // CPU超售比
  208. CpuCommitBound float32 `json:"cpu_commit_bound"`
  209. // 内存超售比
  210. MemCommitBound float32 `json:"mem_commit_bound"`
  211. // 存储大小
  212. Storage int64 `json:"storage"`
  213. // 已使用存储大小
  214. StorageUsed int64 `json:"storage_used"`
  215. // 实际已使用存储大小
  216. ActualStorageUsed int64 `json:"actual_storage_used"`
  217. // 浪费存储大小(异常磁盘存储大小)
  218. StorageWaste int64 `json:"storage_waste"`
  219. // 虚拟存储大小
  220. StorageVirtual int64 `json:"storage_virtual"`
  221. // 可用存储大小
  222. StorageFree int64 `json:"storage_free"`
  223. // 存储超分率
  224. StorageCommitRate float64 `json:"storage_commit_rate"`
  225. Spec *jsonutils.JSONDict `json:"spec"`
  226. IsPrepaidRecycle bool `json:"is_prepaid_recycle"`
  227. CanPrepare bool `json:"can_prepare"`
  228. PrepareFailReason string `json:"prepare_fail_reason"`
  229. // 允许开启宿主机健康检查
  230. AllowHealthCheck bool `json:"allow_health_check"`
  231. AutoMigrateOnHostDown bool `json:"auto_migrate_on_host_down"`
  232. AutoMigrateOnHostShutdown bool `json:"auto_migrate_on_host_shutdown"`
  233. // reserved resource for isolated device
  234. ReservedResourceForGpu *IsolatedDeviceReservedResourceInput `json:"reserved_resource_for_gpu"`
  235. // isolated device count
  236. IsolatedDeviceCount int `json:"isolated_device_count"`
  237. IsolatedDeviceTypeCount map[string]int `json:"isolated_device_type_count"`
  238. GuestPinnedCpus []int `json:"guest_pinned_cpus"`
  239. // host init warnning
  240. SysWarn string `json:"sys_warn"`
  241. // host init error info
  242. SysError string `json:"sys_error"`
  243. HostFiles []string `json:"host_files"`
  244. }
  245. func (self HostDetails) GetMetricTags() map[string]string {
  246. ret := map[string]string{
  247. "id": self.Id,
  248. "host_id": self.Id,
  249. "host_ip": self.AccessIp,
  250. "host": self.Name,
  251. "zone": self.Zone,
  252. "zone_id": self.ZoneId,
  253. "zone_ext_id": self.ZoneExtId,
  254. "status": self.Status,
  255. "cloudregion": self.Cloudregion,
  256. "cloudregion_id": self.CloudregionId,
  257. "region_ext_id": self.RegionExtId,
  258. "brand": self.Brand,
  259. "domain_id": self.DomainId,
  260. "project_domain": self.ProjectDomain,
  261. "account": self.Account,
  262. "res_type": "host",
  263. "account_id": self.AccountId,
  264. "external_id": self.ExternalId,
  265. }
  266. return AppendMetricTags(ret, self.MetadataResourceInfo)
  267. }
  268. func (self HostDetails) GetMetricPairs() map[string]string {
  269. ret := map[string]string{}
  270. return ret
  271. }
  272. type HostInfo struct {
  273. // 宿主机ID
  274. Id string `json:"id"`
  275. // 宿主机名称
  276. Name string `json:"name"`
  277. ResourceType string `json:"resource_type"`
  278. // 宿主机序列号
  279. SN string `json:"sn"`
  280. // 宿主是否启用
  281. Enabled bool `json:"enabled"`
  282. // 宿主机状态
  283. Status string `json:"status"`
  284. // 宿主机计费类型
  285. BillingType string `json:"billing_type"`
  286. // 宿主机服务状态`
  287. HostStatus string `json:"host_status"`
  288. // 宿主机类型
  289. HostType string `json:"host_type"`
  290. // 宿主机管理IP
  291. AccessIp string `json:"access_ip"`
  292. // 宿主机公网IP(如果有)
  293. PublicIp string `json:"public_ip"`
  294. // 宿主机MAC
  295. AccessMac string `json:"access_mac"`
  296. }
  297. type HostResourceInfo struct {
  298. // 归属云订阅ID
  299. ManagerId string `json:"manager_id"`
  300. ManagedResourceInfo
  301. // 归属可用区ID
  302. ZoneId string `json:"zone_id"`
  303. ZoneResourceInfo
  304. // 宿主机名称
  305. Host string `json:"host"`
  306. // 宿主机序列号
  307. HostSN string `json:"host_sn"`
  308. // 宿主是否启用
  309. HostEnabled bool `json:"host_enabled"`
  310. // 宿主机状态
  311. HostStatus string `json:"host_status"`
  312. HostResourceType string `json:"host_resource_type"`
  313. // 宿主机计费类型
  314. HostBillingType billing_api.TBillingType `json:"host_billing_type"`
  315. // 宿主机服务状态`
  316. HostServiceStatus string `json:"host_service_status"`
  317. // 宿主机类型
  318. HostType string `json:"host_type"`
  319. // 宿主机管理IP
  320. HostAccessIp string `json:"host_access_ip"`
  321. // 宿主机公网IP(如果有)
  322. HostEIP string `json:"host_eip"`
  323. // 宿主机MAC
  324. HostAccessMac string `json:"host_access_mac"`
  325. }
  326. type HostFilterListInput struct {
  327. ZonalFilterListInput
  328. ManagedResourceListInput
  329. HostFilterListInputBase
  330. }
  331. type HostFilterListInputBase struct {
  332. HostResourceInput
  333. // 以宿主机序列号过滤
  334. HostSN []string `json:"host_sn"`
  335. // 以宿主机对接二层网络过滤
  336. HostWireId string `json:"host_wire_id"`
  337. // 以宿主机名称排序
  338. OrderByHost string `json:"order_by_host"`
  339. // 以宿主机序列号名称排序
  340. OrderByHostSN string `json:"order_by_host_sn"`
  341. }
  342. type HostResourceInput struct {
  343. // 宿主机或物理机(ID或Name)
  344. HostId string `json:"host_id"`
  345. // swagger:ignore
  346. // Deprecated
  347. // filter by host_id
  348. Host string `json:"host" yunion-deprecated-by:"host_id"`
  349. }
  350. type HostRegisterMetadata struct {
  351. apis.Meta
  352. OnKubernetes bool `json:"on_kubernetes"`
  353. Hostname string `json:"hostname"`
  354. SysError string `json:"sys_error,allowempty"`
  355. SysWarn string `json:"sys_warn,allowempty"`
  356. RootPartitionTotalCapacityMB int64 `json:"root_partition_total_capacity_mb"`
  357. RootPartitionUsedCapacityMB int64 `json:"root_partition_used_capacity_mb"`
  358. }
  359. type HostAccessAttributes struct {
  360. // 物理机管理URI
  361. ManagerUri string `json:"manager_uri"`
  362. // 物理机管理口IP
  363. AccessIp string `json:"access_ip"`
  364. // 物理机管理口MAC
  365. AccessMac string `json:"access_mac"`
  366. // 物理机管理口IP子网
  367. AccessNet string `json:"access_net"`
  368. // 物理机管理口二次网络
  369. AccessWire string `json:"access_wire"`
  370. // 公网IP
  371. PublicIp *string `json:"public_ip"`
  372. }
  373. type HostSizeAttributes struct {
  374. // CPU核数
  375. CpuCount *int `json:"cpu_count"`
  376. // 物理CPU颗数
  377. NodeCount *int8 `json:"node_count"`
  378. // CPU描述信息
  379. CpuDesc string `json:"cpu_desc"`
  380. // CPU频率
  381. CpuMhz *int `json:"cpu_mhz"`
  382. // CPU缓存大小,单位KB
  383. CpuCache string `json:"cpu_cache"`
  384. // 预留CPU大小
  385. CpuReserved *int `json:"cpu_reserved"`
  386. // CPU超分比
  387. CpuCmtbound *float32 `json:"cpu_cmtbound"`
  388. // CPUMicrocode
  389. CpuMicrocode string `json:"cpu_microcode"`
  390. // CPU架构
  391. CpuArchitecture string `json:"cpu_architecture"`
  392. // KVM 允许单台虚机最大 vcpu 个数
  393. KvmCapMaxVcpu *int `json:"kvm_cap_max_vcpu"`
  394. // 内存大小(单位MB)
  395. MemSize string `json:"mem_size"`
  396. // 预留内存大小(单位MB)
  397. MemReserved string `json:"mem_reserved"`
  398. // 内存超分比
  399. MemCmtbound *float32 `json:"mem_cmtbound"`
  400. // 页大小
  401. PageSizeKB *int `json:"page_size_kb"`
  402. // 存储大小,单位Mb
  403. StorageSize *int `json:"storage_size"`
  404. // 存储类型
  405. StorageType string `json:"storage_type"`
  406. // 存储驱动类型
  407. StorageDriver string `json:"storage_driver"`
  408. // 存储详情
  409. StorageInfo jsonutils.JSONObject `json:"storage_info"`
  410. }
  411. type HostIpmiAttributes struct {
  412. // username
  413. IpmiUsername string `json:"ipmi_username"`
  414. // password
  415. IpmiPassword string `json:"ipmi_password"`
  416. // ip address
  417. IpmiIpAddr string `json:"ipmi_ip_addr"`
  418. // presence
  419. IpmiPresent *bool `json:"ipmi_present"`
  420. // lan channel
  421. IpmiLanChannel *uint8 `json:"ipmi_lan_channel"`
  422. // verified
  423. IpmiVerified *bool `json:"ipmi_verified"`
  424. // Redfish API support
  425. IpmiRedfishApi *bool `json:"ipmi_redfish_api"`
  426. // Cdrom boot support
  427. IpmiCdromBoot *bool `json:"ipmi_cdrom_boot"`
  428. // ipmi_pxe_boot
  429. IpmiPxeBoot *bool `json:"ipmi_pxe_boot"`
  430. }
  431. type HostCreateInput struct {
  432. apis.EnabledStatusInfrasResourceBaseCreateInput
  433. ZoneResourceInput
  434. HostnameInput
  435. HostAccessAttributes
  436. HostSizeAttributes
  437. HostIpmiAttributes
  438. // 新建带IPMI信息的物理机时不进行IPMI信息探测
  439. NoProbe *bool `json:"no_probe"`
  440. // 物理机不带 BMC 控制器
  441. NoBMC bool `json:"no_bmc"`
  442. // host uuid
  443. Uuid string `json:"uuid"`
  444. // Host类型
  445. HostType string `json:"host_type"`
  446. // 是否为裸金属
  447. IsBaremetal *bool `json:"is_baremetal"`
  448. // 机架
  449. Rack string `json:"rack"`
  450. // 机位
  451. Slots string `json:"slots"`
  452. // 系统信息
  453. SysInfo jsonutils.JSONObject `json:"sys_info"`
  454. // 物理机序列号信息
  455. SN string `json:"sn"`
  456. // host服务软件版本
  457. Version string `json:"version"`
  458. // OVN软件版本
  459. OvnVersion string `json:"ovn_version"`
  460. // 是否为导入的宿主机
  461. IsImport *bool `json:"is_import"`
  462. // 是否允许PXE启动
  463. EnablePxeBoot *bool `json:"enable_pxe_boot"`
  464. // 主机启动模式, 可能值位PXE和ISO
  465. BootMode string `json:"boot_mode"`
  466. }
  467. type HostUpdateInput struct {
  468. apis.EnabledStatusInfrasResourceBaseUpdateInput
  469. HostAccessAttributes
  470. HostSizeAttributes
  471. HostIpmiAttributes
  472. HostnameInput
  473. // IPMI info
  474. IpmiInfo jsonutils.JSONObject `json:"ipmi_info"`
  475. // 机架
  476. Rack string `json:"rack"`
  477. // 机位
  478. Slots string `json:"slots"`
  479. // 系统信息
  480. SysInfo jsonutils.JSONObject `json:"sys_info"`
  481. // 物理机序列号信息
  482. SN string `json:"sn"`
  483. // 宿主机类型
  484. HostType string `json:"host_type"`
  485. // host服务软件版本
  486. Version string `json:"version"`
  487. // OVN软件版本
  488. OvnVersion string `json:"ovn_version"`
  489. // 是否为裸金属
  490. IsBaremetal *bool `json:"is_baremetal"`
  491. // 是否允许PXE启动
  492. EnablePxeBoot *bool `json:"enable_pxe_boot"`
  493. // 主机UUID
  494. Uuid string `json:"uuid"`
  495. // 主机启动模式, 可能值位PXE和ISO
  496. BootMode string `json:"boot_mode"`
  497. EnableNumaAllocate *bool `json:"enable_numa_allocate"`
  498. }
  499. type HostOfflineInput struct {
  500. UpdateHealthStatus *bool `json:"update_health_status"`
  501. Reason string `json:"reason"`
  502. }
  503. type SHostStorageStat struct {
  504. StorageId string `json:"storage_id"`
  505. CapacityMb int64 `json:"capacity_mb"`
  506. ActualCapacityUsedMb int64 `json:"actual_capacity_used_mb"`
  507. }
  508. type SHostPingInput struct {
  509. WithData bool `json:"with_data"`
  510. MemoryUsedMb int `json:"memory_used_mb"`
  511. CpuUsagePercent float64 `json:"cpu_usage_percent"`
  512. RootPartitionUsedCapacityMb int `json:"root_partition_used_capacity_mb"`
  513. StorageStats []SHostStorageStat `json:"storage_stats"`
  514. QgaRunningGuestIds []string `json:"qga_running_guests"`
  515. }
  516. type SKmsgEntry struct {
  517. Level int `json:"level"`
  518. Seq int `json:"sql"`
  519. Message string `json:"message"`
  520. Time time.Time `json:"time"`
  521. }
  522. type SHostReportDmesgInput struct {
  523. Entries []SKmsgEntry `json:"entries"`
  524. }
  525. type HostReserveCpusInput struct {
  526. Cpus string `json:"cpus"`
  527. Mems string `json:"mems"`
  528. DisableSchedLoadBalance *bool `json:"disable_sched_load_balance"`
  529. ProcessesPrefix []string `json:"processes_prefix"`
  530. }
  531. type HostAutoMigrateInput struct {
  532. AutoMigrateOnHostDown string `json:"auto_migrate_on_host_down"`
  533. AutoMigrateOnHostShutdown string `json:"auto_migrate_on_host_shutdown"`
  534. }
  535. type HostNetifInput struct {
  536. Mac string `json:"mac"`
  537. VlanId int `json:"vlan_id"`
  538. }
  539. type HostAddNetifInput struct {
  540. HostNetifInput
  541. // Deprecated
  542. Wire string `json:"wire" yunion-deprecated-by:"wire_id"`
  543. WireId string `json:"wire_id"`
  544. IpAddr string `json:"ip_addr"`
  545. Rate int `json:"rate"`
  546. NicType cloudmux.TNicType `json:"nic_type"`
  547. Index int `json:"index"`
  548. LinkUp string `json:"link_up"`
  549. Mtu int16 `json:"mtu"`
  550. Reset *bool `json:"reset"`
  551. Interface *string `json:"interface"`
  552. Bridge *string `json:"bridge"`
  553. Reserve *bool `json:"reserve"`
  554. RequireDesignatedIp *bool `json:"require_designated_ip"`
  555. Ip6Addr string `json:"ip6_addr"`
  556. RequireIpv6 *bool `json:"require_ipv6"`
  557. StrictIpv6 *bool `json:"strict_ipv6"`
  558. }
  559. type HostEnableNetifInput struct {
  560. HostNetifInput
  561. // Deprecated
  562. // swagger:ignore
  563. Network string `json:"network" yunion-deprecated-by:"network_id"`
  564. NetworkId string `json:"network_id"`
  565. IpAddr string `json:"ip_addr"`
  566. AllocDir string `json:"alloc_dir"`
  567. NetType TNetworkType `json:"net_type"`
  568. Reserve *bool `json:"reserve"`
  569. RequireDesignatedIp *bool `json:"require_designated_ip"`
  570. Ip6Addr string `json:"ip6_addr"`
  571. RequireIpv6 *bool `json:"require_ipv6"`
  572. StrictIpv6 *bool `json:"strict_ipv6"`
  573. }
  574. type HostDisableNetifInput struct {
  575. HostNetifInput
  576. Reserve *bool `json:"reserve"`
  577. }
  578. type HostRemoveNetifInput struct {
  579. HostNetifInput
  580. Reserve *bool `json:"reserve"`
  581. }
  582. type HostError struct {
  583. Type string `json:"type"`
  584. Id string `json:"id"`
  585. Name string `json:"name"`
  586. Content string `json:"content"`
  587. Time time.Time `json:"time"`
  588. }
  589. type HostSyncErrorsInput struct {
  590. HostErrors []HostError `json:"host_errors"`
  591. }
  592. type HostLoginInfoInput struct {
  593. }
  594. type HostLoginInfoOutput struct {
  595. Ip string `json:"ip"`
  596. Username string `json:"username"`
  597. Password string `json:"password"`
  598. }
  599. type HostPerformStartInput struct {
  600. }
  601. type HostSetCommitBoundInput struct {
  602. CpuCmtbound *float32
  603. MemCmtbound *float32
  604. }
  605. type HostUploadGuestsStatusRequest struct {
  606. GuestIds []string `json:"guest_ids"`
  607. }
  608. type HostUploadGuestStatusInput struct {
  609. apis.PerformStatusInput
  610. Containers map[string]*ContainerPerformStatusInput `json:"containers"`
  611. }
  612. type HostUploadGuestsStatusInput struct {
  613. Guests map[string]*HostUploadGuestStatusInput `json:"guests"`
  614. }
  615. type HostIsolatedDeviceNumaStatsInput struct {
  616. DevType string `json:"dev_type"`
  617. }
  618. type GuestUploadContainerStatusResponse struct {
  619. Error string `json:"error"`
  620. OK bool `json:"ok"`
  621. }
  622. type GuestUploadStatusResponse struct {
  623. Error string `json:"error"`
  624. OK bool `json:"ok"`
  625. Containers map[string]*GuestUploadContainerStatusResponse `json:"containers"`
  626. }
  627. type GuestUploadStatusesResponse struct {
  628. Guests map[string]*GuestUploadStatusResponse `json:"guests"`
  629. }