Added storage_provider_name to storage_pool_view

Signed-off-by: Edison Su <sudison@gmail.com>
This commit is contained in:
Chris Suich 2013-10-07 08:38:47 -04:00 committed by Edison Su
parent d1a536a4e3
commit 4c2e40ac37
2 changed files with 65 additions and 7 deletions

View File

@ -24,17 +24,16 @@ import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import com.cloud.org.Cluster;
import com.cloud.storage.ScopeType;
import com.cloud.storage.StoragePoolStatus;
import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.utils.db.GenericDao;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.org.Cluster;
import com.cloud.storage.ScopeType;
import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.StoragePoolStatus;
import com.cloud.utils.db.GenericDao;
/**
* Storage Pool DB view.
@ -137,6 +136,9 @@ public class StoragePoolJoinVO extends BaseViewVO implements InternalIdentity, I
@Enumerated(value = EnumType.STRING)
private HypervisorType hypervisor;
@Column(name = "storage_provider_name")
private String storageProviderName;
/**
* @return the scope
*/
@ -378,5 +380,7 @@ public class StoragePoolJoinVO extends BaseViewVO implements InternalIdentity, I
this.jobStatus = jobStatus;
}
public String getStorageProviderName() {
return storageProviderName;
}
}

View File

@ -281,6 +281,7 @@ CREATE VIEW `cloud`.`template_view` AS
and (resource_tags.resource_type = 'Template' or resource_tags.resource_type='ISO')
where
vm_template.state='Active';
DROP VIEW IF EXISTS `cloud`.`volume_view`;
CREATE VIEW `cloud`.`volume_view` AS
select
@ -392,3 +393,56 @@ CREATE VIEW `cloud`.`volume_view` AS
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');
DROP VIEW IF EXISTS `cloud`.`storage_pool_view`;
CREATE VIEW `cloud`.`storage_pool_view` AS
select
storage_pool.id,
storage_pool.uuid,
storage_pool.name,
storage_pool.status,
storage_pool.path,
storage_pool.pool_type,
storage_pool.host_address,
storage_pool.created,
storage_pool.removed,
storage_pool.capacity_bytes,
storage_pool.capacity_iops,
storage_pool.scope,
storage_pool.hypervisor,
storage_pool.storage_provider_name,
cluster.id cluster_id,
cluster.uuid cluster_uuid,
cluster.name cluster_name,
cluster.cluster_type,
data_center.id data_center_id,
data_center.uuid data_center_uuid,
data_center.name data_center_name,
data_center.networktype data_center_type,
host_pod_ref.id pod_id,
host_pod_ref.uuid pod_uuid,
host_pod_ref.name pod_name,
storage_pool_details.name tag,
op_host_capacity.used_capacity disk_used_capacity,
op_host_capacity.reserved_capacity disk_reserved_capacity,
async_job.id job_id,
async_job.uuid job_uuid,
async_job.job_status job_status,
async_job.account_id job_account_id
from
`cloud`.`storage_pool`
left join
`cloud`.`cluster` ON storage_pool.cluster_id = cluster.id
left join
`cloud`.`data_center` ON storage_pool.data_center_id = data_center.id
left join
`cloud`.`host_pod_ref` ON storage_pool.pod_id = host_pod_ref.id
left join
`cloud`.`storage_pool_details` ON storage_pool_details.pool_id = storage_pool.id
and storage_pool_details.value = 'true'
left join
`cloud`.`op_host_capacity` ON storage_pool.id = op_host_capacity.host_id
and op_host_capacity.capacity_type = 3
left join
`cloud`.`async_job` ON async_job.instance_id = storage_pool.id
and async_job.instance_type = 'StoragePool'
and async_job.job_status = 0;