@@ -2971,3 +2971,60 @@ from project_invitations
29712971left join account on project_invitations .account_id = account .id
29722972left join domain on project_invitations .domain_id = domain .id
29732973left join projects on projects .id = project_invitations .project_id ;
2974+
2975+ DROP VIEW IF EXISTS ` cloud` .` host_view` ;
2976+ CREATE VIEW host_view AS
2977+ select
2978+ host .id ,
2979+ host .uuid ,
2980+ host .name ,
2981+ host .status ,
2982+ host .disconnected ,
2983+ host .type ,
2984+ host .private_ip_address ,
2985+ host .version ,
2986+ host .hypervisor_type ,
2987+ host .hypervisor_version ,
2988+ host .capabilities ,
2989+ host .last_ping ,
2990+ host .created ,
2991+ host .removed ,
2992+ host .resource_state ,
2993+ host .mgmt_server_id ,
2994+ host .cpus ,
2995+ host .speed ,
2996+ host .ram ,
2997+ cluster .id cluster_id,
2998+ cluster .uuid cluster_uuid,
2999+ cluster .name cluster_name,
3000+ cluster .cluster_type ,
3001+ data_center .id data_center_id,
3002+ data_center .uuid data_center_uuid,
3003+ data_center .name data_center_name,
3004+ host_pod_ref .id pod_id,
3005+ host_pod_ref .uuid pod_uuid,
3006+ host_pod_ref .name pod_name,
3007+ host_tags .tag ,
3008+ guest_os_category .id guest_os_category_id,
3009+ guest_os_category .uuid guest_os_category_uuid,
3010+ guest_os_category .name guest_os_category_name,
3011+ mem_caps .used_capacity memory_used_capacity,
3012+ mem_caps .reserved_capacity memory_reserved_capacity,
3013+ cpu_caps .used_capacity cpu_used_capacity,
3014+ cpu_caps .reserved_capacity cpu_reserved_capacity,
3015+ async_job .id job_id,
3016+ async_job .uuid job_uuid,
3017+ async_job .job_status job_status,
3018+ async_job .account_id job_account_id
3019+ from host
3020+ left join cluster on host .cluster_id = cluster .id
3021+ left join data_center on host .data_center_id = data_center .id
3022+ left join host_pod_ref on host .pod_id = host_pod_ref .id
3023+ left join host_details on host .id = host_details .id and host_details .name = " guest.os.category.id"
3024+ left join guest_os_category on guest_os_category .id = CONVERT ( host_details .value , UNSIGNED )
3025+ left join host_tags on host_tags .host_id = host .id
3026+ left join op_host_capacity mem_caps on host .id = mem_caps .host_id and mem_caps .capacity_type = 0
3027+ left join op_host_capacity cpu_caps on host .id = cpu_caps .host_id and cpu_caps .capacity_type = 1
3028+ left join async_job on async_job .instance_id = host .id and async_job .instance_type = " Host" and async_job .job_status = 0 ;
3029+
3030+
0 commit comments