Skip to content

Commit 4c2e40a

Browse files
csuich2sudison
authored andcommitted
Added storage_provider_name to storage_pool_view
Signed-off-by: Edison Su <sudison@gmail.com>
1 parent d1a536a commit 4c2e40a

2 files changed

Lines changed: 65 additions & 7 deletions

File tree

server/src/com/cloud/api/query/vo/StoragePoolJoinVO.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,16 @@
2424
import javax.persistence.Enumerated;
2525
import javax.persistence.Id;
2626
import javax.persistence.Table;
27-
import com.cloud.org.Cluster;
28-
import com.cloud.storage.ScopeType;
29-
import com.cloud.storage.StoragePoolStatus;
30-
import com.cloud.storage.Storage.StoragePoolType;
31-
import com.cloud.utils.db.GenericDao;
3227

3328
import org.apache.cloudstack.api.Identity;
3429
import org.apache.cloudstack.api.InternalIdentity;
3530

36-
3731
import com.cloud.hypervisor.Hypervisor.HypervisorType;
32+
import com.cloud.org.Cluster;
33+
import com.cloud.storage.ScopeType;
34+
import com.cloud.storage.Storage.StoragePoolType;
35+
import com.cloud.storage.StoragePoolStatus;
36+
import com.cloud.utils.db.GenericDao;
3837

3938
/**
4039
* Storage Pool DB view.
@@ -137,6 +136,9 @@ public class StoragePoolJoinVO extends BaseViewVO implements InternalIdentity, I
137136
@Enumerated(value = EnumType.STRING)
138137
private HypervisorType hypervisor;
139138

139+
@Column(name = "storage_provider_name")
140+
private String storageProviderName;
141+
140142
/**
141143
* @return the scope
142144
*/
@@ -378,5 +380,7 @@ public void setJobStatus(int jobStatus) {
378380
this.jobStatus = jobStatus;
379381
}
380382

381-
383+
public String getStorageProviderName() {
384+
return storageProviderName;
385+
}
382386
}

setup/db/db/schema-420to430.sql

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ CREATE VIEW `cloud`.`template_view` AS
281281
and (resource_tags.resource_type = 'Template' or resource_tags.resource_type='ISO')
282282
where
283283
vm_template.state='Active';
284+
284285
DROP VIEW IF EXISTS `cloud`.`volume_view`;
285286
CREATE VIEW `cloud`.`volume_view` AS
286287
select
@@ -392,3 +393,56 @@ CREATE VIEW `cloud`.`volume_view` AS
392393

393394
INSERT IGNORE INTO `cloud`.`configuration`(category, instance, component, name, value, description, default_value) VALUES ('Advanced', 'DEFAULT', 'management-server', 's3.multipart.enabled', 'true', 'enable s3 multipart upload', 'true');
394395

396+
DROP VIEW IF EXISTS `cloud`.`storage_pool_view`;
397+
CREATE VIEW `cloud`.`storage_pool_view` AS
398+
select
399+
storage_pool.id,
400+
storage_pool.uuid,
401+
storage_pool.name,
402+
storage_pool.status,
403+
storage_pool.path,
404+
storage_pool.pool_type,
405+
storage_pool.host_address,
406+
storage_pool.created,
407+
storage_pool.removed,
408+
storage_pool.capacity_bytes,
409+
storage_pool.capacity_iops,
410+
storage_pool.scope,
411+
storage_pool.hypervisor,
412+
storage_pool.storage_provider_name,
413+
cluster.id cluster_id,
414+
cluster.uuid cluster_uuid,
415+
cluster.name cluster_name,
416+
cluster.cluster_type,
417+
data_center.id data_center_id,
418+
data_center.uuid data_center_uuid,
419+
data_center.name data_center_name,
420+
data_center.networktype data_center_type,
421+
host_pod_ref.id pod_id,
422+
host_pod_ref.uuid pod_uuid,
423+
host_pod_ref.name pod_name,
424+
storage_pool_details.name tag,
425+
op_host_capacity.used_capacity disk_used_capacity,
426+
op_host_capacity.reserved_capacity disk_reserved_capacity,
427+
async_job.id job_id,
428+
async_job.uuid job_uuid,
429+
async_job.job_status job_status,
430+
async_job.account_id job_account_id
431+
from
432+
`cloud`.`storage_pool`
433+
left join
434+
`cloud`.`cluster` ON storage_pool.cluster_id = cluster.id
435+
left join
436+
`cloud`.`data_center` ON storage_pool.data_center_id = data_center.id
437+
left join
438+
`cloud`.`host_pod_ref` ON storage_pool.pod_id = host_pod_ref.id
439+
left join
440+
`cloud`.`storage_pool_details` ON storage_pool_details.pool_id = storage_pool.id
441+
and storage_pool_details.value = 'true'
442+
left join
443+
`cloud`.`op_host_capacity` ON storage_pool.id = op_host_capacity.host_id
444+
and op_host_capacity.capacity_type = 3
445+
left join
446+
`cloud`.`async_job` ON async_job.instance_id = storage_pool.id
447+
and async_job.instance_type = 'StoragePool'
448+
and async_job.job_status = 0;

0 commit comments

Comments
 (0)