cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [1/2] git commit: updated refs/heads/master to 1ed5c20
Date Fri, 11 Dec 2015 16:15:46 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 312b9aff9 -> 1ed5c2090


CLOUDSTACK-9129: list vpc routers by keyword in Infrastructure -> Virtual Routers

and two more changes:
(1) add network name/vpc name in the listRouters response
(2) add network name/vpc id, vpc name in the router details page


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/24f1396a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/24f1396a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/24f1396a

Branch: refs/heads/master
Commit: 24f1396ac1625bff56e3e72e0065fc9410a7272f
Parents: 738b788
Author: Wei Zhou <w.zhou@tech.leaseweb.com>
Authored: Wed Dec 9 09:07:57 2015 +0100
Committer: Wei Zhou <w.zhou@tech.leaseweb.com>
Committed: Thu Dec 10 09:14:12 2015 +0100

----------------------------------------------------------------------
 .../api/response/DomainRouterResponse.java      |  16 +++
 .../com/cloud/api/query/QueryManagerImpl.java   |   1 +
 .../api/query/dao/DomainRouterJoinDaoImpl.java  |   3 +
 .../cloud/api/query/vo/DomainRouterJoinVO.java  |   7 ++
 setup/db/db/schema-461to470.sql                 | 107 +++++++++++++++++++
 ui/scripts/system.js                            |  71 ++++++++++++
 6 files changed, 205 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24f1396a/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java b/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java
index 9225ba0..131e3e1 100644
--- a/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java
@@ -137,6 +137,10 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView
     @Param(description = "the ID of the corresponding guest network")
     private String guestNetworkId;
 
+    @SerializedName("guestnetworkname")
+    @Param(description = "the name of the corresponding guest network")
+    private String guestNetworkName;
+
     @SerializedName(ApiConstants.TEMPLATE_ID)
     @Param(description = "the template ID for the router")
     private String templateId;
@@ -197,6 +201,10 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView
     @Param(description = "VPC the router belongs to")
     private String vpcId;
 
+    @SerializedName("vpcname")
+    @Param(description = "the name of VPC the router belongs to")
+    private String vpcName;
+
     @SerializedName(ApiConstants.ROLE)
     @Param(description = "role of the domain router")
     private String role;
@@ -333,6 +341,10 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView
         this.guestNetworkId = guestNetworkId;
     }
 
+    public void setGuestNetworkName(String guestNetworkName) {
+        this.guestNetworkName = guestNetworkName;
+    }
+
     public void setLinkLocalIp(String linkLocalIp) {
         this.linkLocalIp = linkLocalIp;
     }
@@ -395,6 +407,10 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView
         this.vpcId = vpcId;
     }
 
+    public void setVpcName(String vpcName) {
+        this.vpcName = vpcName;
+    }
+
     public void setNics(Set<NicResponse> nics) {
         this.nics = nics;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24f1396a/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index 0c72710..a87d9fb 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -1225,6 +1225,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService,
Confi
             ssc.addOr("instanceName", SearchCriteria.Op.LIKE, "%" + keyword + "%");
             ssc.addOr("state", SearchCriteria.Op.LIKE, "%" + keyword + "%");
             ssc.addOr("networkName", SearchCriteria.Op.LIKE, "%" + keyword + "%");
+            ssc.addOr("vpcName", SearchCriteria.Op.LIKE, "%" + keyword + "%");
 
             sc.addAnd("instanceName", SearchCriteria.Op.SC, ssc);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24f1396a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
index a4ec3e8..e3d1e30 100644
--- a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
@@ -116,6 +116,7 @@ public class DomainRouterJoinDaoImpl extends GenericDaoBase<DomainRouterJoinVO,
                         routerResponse.setGuestMacAddress(router.getMacAddress());
                         routerResponse.setGuestNetmask(router.getNetmask());
                         routerResponse.setGuestNetworkId(router.getNetworkUuid());
+                        routerResponse.setGuestNetworkName(router.getNetworkName());
                         routerResponse.setNetworkDomain(router.getNetworkDomain());
                     }
                 }
@@ -166,6 +167,7 @@ public class DomainRouterJoinDaoImpl extends GenericDaoBase<DomainRouterJoinVO,
         routerResponse.setIp6Dns2(router.getIp6Dns2());
 
         routerResponse.setVpcId(router.getVpcUuid());
+        routerResponse.setVpcName(router.getVpcName());
 
         routerResponse.setRole(router.getRole().toString());
 
@@ -208,6 +210,7 @@ public class DomainRouterJoinDaoImpl extends GenericDaoBase<DomainRouterJoinVO,
                     vrData.setGuestMacAddress(vr.getMacAddress());
                     vrData.setGuestNetmask(vr.getNetmask());
                     vrData.setGuestNetworkId(vr.getNetworkUuid());
+                    vrData.setGuestNetworkName(vr.getNetworkName());
                     vrData.setNetworkDomain(vr.getNetworkDomain());
                 }
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24f1396a/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java b/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java
index 8984ff5..d34bd5e 100644
--- a/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java
@@ -152,6 +152,9 @@ public class DomainRouterJoinVO extends BaseViewVO implements ControlledViewEnti
     @Column(name = "vpc_uuid")
     private String vpcUuid;
 
+    @Column(name = "vpc_name")
+    private String vpcName;
+
     @Column(name = "nic_id")
     private long nicId;
 
@@ -371,6 +374,10 @@ public class DomainRouterJoinVO extends BaseViewVO implements ControlledViewEnti
         return vpcId;
     }
 
+    public String getVpcName() {
+        return vpcName;
+    }
+
     public long getNicId() {
         return nicId;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24f1396a/setup/db/db/schema-461to470.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-461to470.sql b/setup/db/db/schema-461to470.sql
index d738545..dc9f1ce 100644
--- a/setup/db/db/schema-461to470.sql
+++ b/setup/db/db/schema-461to470.sql
@@ -140,3 +140,110 @@ INSERT IGNORE INTO `cloud_usage`.`quota_email_templates` (`template_name`,
`temp
  ('QUOTA_UNLOCK_ACCOUNT', 'Quota credits added, account ${accountName} is unlocked now, if
it was locked', 'Your account ${accountName} in the domain ${domainName} has enough quota
credits now with the current balance of ${quotaBalance}.'),
  ('QUOTA_STATEMENT', 'Quota Statement for your account ${accountName}', 'Monthly quota statement
of your account ${accountName} in the domain ${domainName}:<br>Balance = ${quotaBalance}<br>Total
Usage = ${quotaUsage}.');
 UNLOCK TABLES;
+
+
+DROP VIEW IF EXISTS `cloud`.`domain_router_view`;
+CREATE VIEW `cloud`.`domain_router_view` AS
+    select
+        vm_instance.id id,
+        vm_instance.name name,
+        account.id account_id,
+        account.uuid account_uuid,
+        account.account_name account_name,
+        account.type account_type,
+        domain.id domain_id,
+        domain.uuid domain_uuid,
+        domain.name domain_name,
+        domain.path domain_path,
+        projects.id project_id,
+        projects.uuid project_uuid,
+        projects.name project_name,
+        vm_instance.uuid uuid,
+        vm_instance.created created,
+        vm_instance.state state,
+        vm_instance.removed removed,
+        vm_instance.pod_id pod_id,
+        vm_instance.instance_name instance_name,
+        host_pod_ref.uuid pod_uuid,
+        data_center.id data_center_id,
+        data_center.uuid data_center_uuid,
+        data_center.name data_center_name,
+        data_center.networktype data_center_type,
+        data_center.dns1 dns1,
+        data_center.dns2 dns2,
+        data_center.ip6_dns1 ip6_dns1,
+        data_center.ip6_dns2 ip6_dns2,
+        host.id host_id,
+        host.uuid host_uuid,
+        host.name host_name,
+        host.hypervisor_type,
+        host.cluster_id cluster_id,
+        vm_template.id template_id,
+        vm_template.uuid template_uuid,
+        service_offering.id service_offering_id,
+        disk_offering.uuid service_offering_uuid,
+        disk_offering.name service_offering_name,
+        nics.id nic_id,
+        nics.uuid nic_uuid,
+        nics.network_id network_id,
+        nics.ip4_address ip_address,
+        nics.ip6_address ip6_address,
+        nics.ip6_gateway ip6_gateway,
+        nics.ip6_cidr ip6_cidr,
+        nics.default_nic is_default_nic,
+        nics.gateway gateway,
+        nics.netmask netmask,
+        nics.mac_address mac_address,
+        nics.broadcast_uri broadcast_uri,
+        nics.isolation_uri isolation_uri,
+        vpc.id vpc_id,
+        vpc.uuid vpc_uuid,
+        vpc.name vpc_name,
+        networks.uuid network_uuid,
+        networks.name network_name,
+        networks.network_domain network_domain,
+        networks.traffic_type traffic_type,
+        networks.guest_type guest_type,
+        async_job.id job_id,
+        async_job.uuid job_uuid,
+        async_job.job_status job_status,
+        async_job.account_id job_account_id,
+        domain_router.template_version template_version,
+        domain_router.scripts_version scripts_version,
+        domain_router.is_redundant_router is_redundant_router,
+        domain_router.redundant_state redundant_state,
+        domain_router.stop_pending stop_pending,
+        domain_router.role role
+    from
+        `cloud`.`domain_router`
+            inner join
+        `cloud`.`vm_instance` ON vm_instance.id = domain_router.id
+            inner join
+        `cloud`.`account` ON vm_instance.account_id = account.id
+            inner join
+        `cloud`.`domain` ON vm_instance.domain_id = domain.id
+            left join
+        `cloud`.`host_pod_ref` ON vm_instance.pod_id = host_pod_ref.id
+            left join
+        `cloud`.`projects` ON projects.project_account_id = account.id
+            left join
+        `cloud`.`data_center` ON vm_instance.data_center_id = data_center.id
+            left join
+        `cloud`.`host` ON vm_instance.host_id = host.id
+            left join
+        `cloud`.`vm_template` ON vm_instance.vm_template_id = vm_template.id
+            left join
+        `cloud`.`service_offering` ON vm_instance.service_offering_id = service_offering.id
+            left join
+        `cloud`.`disk_offering` ON vm_instance.service_offering_id = disk_offering.id
+            left join
+        `cloud`.`nics` ON vm_instance.id = nics.instance_id and nics.removed is null
+            left join
+        `cloud`.`networks` ON nics.network_id = networks.id
+            left join
+        `cloud`.`vpc` ON domain_router.vpc_id = vpc.id and vpc.removed is null
+            left join
+        `cloud`.`async_job` ON async_job.instance_id = vm_instance.id
+            and async_job.instance_type = 'DomainRouter'
+            and async_job.job_status = 0;
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24f1396a/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 33aafc5..af69359 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -2721,6 +2721,15 @@
                                                         hiddenFields.push('publicip');
                                                         //In Basic zone, guest IP is public
IP. So, publicip is not returned by listRouters API. Only guestipaddress is returned by listRouters
API.
                                                     }
+
+                                                    if ('routers' in args.context &&
args.context.routers[0].vpcid != undefined) {
+                                                        hiddenFields.push('guestnetworkid');
+                                                        hiddenFields.push('guestnetworkname');
+                                                    } else if ('routers' in args.context
&& args.context.routers[0].guestnetworkid != undefined) {
+                                                        hiddenFields.push('vpcid');
+                                                        hiddenFields.push('vpcname');
+                                                    }
+
                                                     return hiddenFields;
                                                 },
                                                 fields:[ {
@@ -2744,6 +2753,15 @@
                                                     guestnetworkid: {
                                                         label: 'label.network.id'
                                                     },
+                                                    guestnetworkname: {
+                                                        label: 'label.network.name'
+                                                    },
+                                                    vpcid: {
+                                                        label: 'label.vpc.id'
+                                                    },
+                                                    vpcname: {
+                                                        label: 'label.vpc'
+                                                    },
                                                     publicip: {
                                                         label: 'label.public.ip'
                                                     },
@@ -3247,6 +3265,15 @@
                                                         hiddenFields.push('publicip');
                                                         //In Basic zone, guest IP is public
IP. So, publicip is not returned by listRouters API. Only guestipaddress is returned by listRouters
API.
                                                     }
+
+                                                    if ('routers' in args.context &&
args.context.routers[0].vpcid != undefined) {
+                                                        hiddenFields.push('guestnetworkid');
+                                                        hiddenFields.push('guestnetworkname');
+                                                    } else if ('routers' in args.context
&& args.context.routers[0].guestnetworkid != undefined) {
+                                                        hiddenFields.push('vpcid');
+                                                        hiddenFields.push('vpcname');
+                                                    }
+
                                                     return hiddenFields;
                                                 },
                                                 fields:[ {
@@ -3270,6 +3297,15 @@
                                                     guestnetworkid: {
                                                         label: 'label.network.id'
                                                     },
+                                                    guestnetworkname: {
+                                                        label: 'label.network.name'
+                                                    },
+                                                    vpcid: {
+                                                        label: 'label.vpc.id'
+                                                    },
+                                                    vpcname: {
+                                                        label: 'label.vpc'
+                                                    },
                                                     publicip: {
                                                         label: 'label.public.ip'
                                                     },
@@ -6771,6 +6807,15 @@
                                                         hiddenFields.push('publicip');
                                                         //In Basic zone, guest IP is public
IP. So, publicip is not returned by listRouters API. Only guestipaddress is returned by listRouters
API.
                                                     }
+
+                                                    if ('routers' in args.context &&
args.context.routers[0].vpcid != undefined) {
+                                                        hiddenFields.push('guestnetworkid');
+                                                        hiddenFields.push('guestnetworkname');
+                                                    } else if ('routers' in args.context
&& args.context.routers[0].guestnetworkid != undefined) {
+                                                        hiddenFields.push('vpcid');
+                                                        hiddenFields.push('vpcname');
+                                                    }
+
                                                     return hiddenFields;
                                                 },
                                                 fields:[ {
@@ -6794,6 +6839,15 @@
                                                     guestnetworkid: {
                                                         label: 'label.network.id'
                                                     },
+                                                    guestnetworkname: {
+                                                        label: 'label.network.name'
+                                                    },
+                                                    vpcid: {
+                                                        label: 'label.vpc.id'
+                                                    },
+                                                    vpcname: {
+                                                        label: 'label.vpc'
+                                                    },
                                                     publicip: {
                                                         label: 'label.public.ip'
                                                     },
@@ -10042,6 +10096,14 @@
                                                 }
                                             });
 
+                                            if ('routers' in args.context && args.context.routers[0].vpcid
!= undefined) {
+                                                hiddenFields.push('guestnetworkid');
+                                                hiddenFields.push('guestnetworkname');
+                                            } else if ('routers' in args.context &&
args.context.routers[0].guestnetworkid != undefined) {
+                                                hiddenFields.push('vpcid');
+                                                hiddenFields.push('vpcname');
+                                            }
+
                                             return hiddenFields;
                                         },
                                         fields:[ {
@@ -10072,6 +10134,15 @@
                                             guestnetworkid: {
                                                 label: 'label.network.id'
                                             },
+                                            guestnetworkname: {
+                                                label: 'label.network.name'
+                                            },
+                                            vpcid: {
+                                                label: 'label.vpc.id'
+                                            },
+                                            vpcname: {
+                                                label: 'label.vpc'
+                                            },
                                             publicip: {
                                                 label: 'label.public.ip'
                                             },


Mime
View raw message