diff --git a/api/src/com/cloud/api/BaseCmd.java b/api/src/com/cloud/api/BaseCmd.java index 9fe4dd5f84f..d88ce7b6fe3 100755 --- a/api/src/com/cloud/api/BaseCmd.java +++ b/api/src/com/cloud/api/BaseCmd.java @@ -183,6 +183,10 @@ public abstract class BaseCmd { _responseObject = responseObject; } + public ManagementService getMgmtServiceRef() { + return _mgr; + } + public static String getDateString(Date date) { if (date == null) { return ""; diff --git a/api/src/com/cloud/api/commands/AuthorizeSecurityGroupIngressCmd.java b/api/src/com/cloud/api/commands/AuthorizeSecurityGroupIngressCmd.java index 1c505c7f6da..33fc240d17c 100644 --- a/api/src/com/cloud/api/commands/AuthorizeSecurityGroupIngressCmd.java +++ b/api/src/com/cloud/api/commands/AuthorizeSecurityGroupIngressCmd.java @@ -205,9 +205,11 @@ public class AuthorizeSecurityGroupIngressCmd extends BaseAsyncCmd { @Override public void execute() { - for(String cidr : cidrList ){ - if (!NetUtils.isValidCIDR(cidr)){ - throw new ServerApiException(BaseCmd.PARAM_ERROR, cidr + " is an Invalid CIDR "); + if(cidrList != null){ + for(String cidr : cidrList ){ + if (!NetUtils.isValidCIDR(cidr)){ + throw new ServerApiException(BaseCmd.PARAM_ERROR, cidr + " is an Invalid CIDR "); + } } } List extends SecurityRule> ingressRules = _securityGroupService.authorizeSecurityGroupIngress(this); diff --git a/api/src/com/cloud/api/commands/ListClustersCmd.java b/api/src/com/cloud/api/commands/ListClustersCmd.java index 9dc6da09303..c8af568fe23 100755 --- a/api/src/com/cloud/api/commands/ListClustersCmd.java +++ b/api/src/com/cloud/api/commands/ListClustersCmd.java @@ -22,7 +22,6 @@ import com.cloud.api.BaseListCmd; import com.cloud.api.IdentityMapper; import com.cloud.api.Implementation; import com.cloud.api.Parameter; -import com.cloud.api.BaseCmd.CommandType; import com.cloud.api.response.ClusterResponse; import com.cloud.api.response.ListResponse; import com.cloud.org.Cluster; diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java index e36cc81b19a..84c4d0dade7 100755 --- a/api/src/com/cloud/server/ManagementService.java +++ b/api/src/com/cloud/server/ManagementService.java @@ -127,6 +127,13 @@ public interface ManagementService { * @return */ List extends Cluster> searchForClusters(ListClustersCmd c); + + /** + * Searches for Clusters by the specified zone Id. + * @param zoneId + * @return + */ + List extends Cluster> searchForClusters(long zoneId, Long startIndex, Long pageSizeVal, String hypervisorType); /** * Searches for Pods by the specified search criteria Can search by: pod name and/or zone name diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index 4c566c7ed13..f51a5f2a6b7 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -114,7 +114,7 @@ label.corrections.saved=Corrections saved message.installWizard.copy.whatIsSecondaryStorage=Secondary storage is associated with a zone, and it stores the following:
').html(_l(content))) + $('
').html(checkTitle(_l(content)))) ); }, @@ -214,8 +226,8 @@ return $('
').addClass('header') .append( $.merge( - $('').html(_l('label.installWizard.title')), - $('').html(_l('label.installWizard.subtitle')) + $('').html(checkTitle(_l('label.installWizard.title'))), + $('').html(checkTitle(_l('label.installWizard.subtitle'))) ) ); }, @@ -297,8 +309,8 @@ var steps = { eula: function(args) { var $intro = $('').addClass('intro eula'); - var $title = $('').addClass('title').html(_l('label.license.agreement')); - var $subtitle = $('').addClass('subtitle').html(_l('label.license.agreement.subtitle')); + var $title = $('').addClass('title').html(checkTitle(_l('label.license.agreement'))); + var $subtitle = $('').addClass('subtitle').html(checkTitle(_l('label.license.agreement.subtitle'))); var $copy = $('').addClass('eula-copy').html(eulaHTML); var $continue = elems.nextButton(_l('label.agree')); @@ -314,12 +326,17 @@ }, intro: function(args) { - var $intro = $('').addClass('intro what-is-cloudstack'); - var $title = $('').addClass('title').html(_l('label.what.is.cloudstack')); - var $subtitle = $('').addClass('subtitle').html(_l('label.introduction.to.cloudstack')); + if (eulaHTML && eulaHTML.length){ + var $intro = $('').addClass('intro what-is-cloudplatform'); } + else { + var $intro = $('').addClass('intro what-is-cloudstack'); + + } + var $title = $('').addClass('title').html(checkTitle(_l('label.what.is.cloudstack'))); + var $subtitle = $('').addClass('subtitle').html(checkTitle(_l('label.introduction.to.cloudstack'))); var $copy = getCopy('whatIsCloudStack', $('')); var $continue = elems.nextButton(_l('label.continue.basic.install')); - var $advanced = elems.nextButton(_l('label.skip.guide')).addClass('advanced-installation'); + var $advanced = elems.nextButton(checkTitle(_l('label.skip.guide'))).addClass('advanced-installation'); $continue.click(function() { goTo('changeUser'); @@ -792,6 +809,7 @@ var initialStep = eulaHTML ? steps.eula().addClass('step') : steps.intro().addClass('step'); + showDiagram(''); $('html body').addClass('install-wizard'); @@ -801,7 +819,9 @@ elems.body().append(initialStep), $diagramParts ).appendTo($container); - }; + + + }; cloudStack.uiCustom.installWizard = installWizard; }(jQuery, cloudStack)); diff --git a/utils/src/com/cloud/utils/cisco/n1kv/vsm/NetconfHelper.java b/utils/src/com/cloud/utils/cisco/n1kv/vsm/NetconfHelper.java index 9ed83c7356c..0ad368a4dfe 100644 --- a/utils/src/com/cloud/utils/cisco/n1kv/vsm/NetconfHelper.java +++ b/utils/src/com/cloud/utils/cisco/n1kv/vsm/NetconfHelper.java @@ -125,7 +125,7 @@ public class NetconfHelper { public void addPolicyMap(String name, int averageRate, int maxRate, int burstRate) throws CloudRuntimeException { - String command = VsmCommand.getPolicyMap(name, averageRate, maxRate, burstRate); + String command = VsmCommand.getAddPolicyMap(name, averageRate, maxRate, burstRate); if (command != null) { command = command.concat(SSH_NETCONF_TERMINATOR); send(command); @@ -180,18 +180,39 @@ public class NetconfHelper { } } - public void getPortProfileByName(String name) throws CloudRuntimeException { + public PortProfile getPortProfileByName(String name) throws CloudRuntimeException { String command = VsmCommand.getPortProfile(name); if (command != null) { command = command.concat(SSH_NETCONF_TERMINATOR); send(command); // parse the rpc reply. - VsmPortProfileResponse response = new VsmPortProfileResponse(receive().trim()); + String received = receive(); + VsmPortProfileResponse response = new VsmPortProfileResponse(received.trim()); if (!response.isResponseOk()) { throw new CloudRuntimeException("Error response while getting the port profile details."); + } else { + return response.getPortProfile(); } } else { - throw new CloudRuntimeException("Error generating rpc request for removing policy map."); + throw new CloudRuntimeException("Error generating rpc request for getting port profile."); + } + } + + public PolicyMap getPolicyMapByName(String name) throws CloudRuntimeException { + String command = VsmCommand.getPolicyMap(name); + if (command != null) { + command = command.concat(SSH_NETCONF_TERMINATOR); + send(command); + // parse the rpc reply. + String received = receive(); + VsmPolicyMapResponse response = new VsmPolicyMapResponse(received.trim()); + if (!response.isResponseOk()) { + throw new CloudRuntimeException("Error response while getting the port profile details."); + } else { + return response.getPolicyMap(); + } + } else { + throw new CloudRuntimeException("Error generating rpc request for getting policy map."); } } diff --git a/utils/src/com/cloud/utils/cisco/n1kv/vsm/PolicyMap.java b/utils/src/com/cloud/utils/cisco/n1kv/vsm/PolicyMap.java new file mode 100644 index 00000000000..08b552258b3 --- /dev/null +++ b/utils/src/com/cloud/utils/cisco/n1kv/vsm/PolicyMap.java @@ -0,0 +1,15 @@ +package com.cloud.utils.cisco.n1kv.vsm; + +public class PolicyMap { + public String policyMapName; + public int committedRate; + public int burstRate; + public int peakRate; + + PolicyMap() { + policyMapName = null; + committedRate = 0; + burstRate = 0; + peakRate = 0; + } +} diff --git a/utils/src/com/cloud/utils/cisco/n1kv/vsm/PortProfile.java b/utils/src/com/cloud/utils/cisco/n1kv/vsm/PortProfile.java new file mode 100644 index 00000000000..10fc6f13fdd --- /dev/null +++ b/utils/src/com/cloud/utils/cisco/n1kv/vsm/PortProfile.java @@ -0,0 +1,29 @@ +package com.cloud.utils.cisco.n1kv.vsm; + +import com.cloud.utils.cisco.n1kv.vsm.VsmCommand.BindingType; +import com.cloud.utils.cisco.n1kv.vsm.VsmCommand.PortProfileType; +import com.cloud.utils.cisco.n1kv.vsm.VsmCommand.SwitchPortMode; + +public class PortProfile { + public PortProfileType type; + public SwitchPortMode mode; + public BindingType binding; + public String profileName; + public String inputPolicyMap; + public String outputPolicyMap; + public String vlan; + public boolean status; + public int maxPorts; + + PortProfile() { + profileName = null; + inputPolicyMap = null; + outputPolicyMap = null; + vlan = null; + status = false; + maxPorts = 32; + type = PortProfileType.none; + mode = SwitchPortMode.none; + binding = BindingType.none; + } +} diff --git a/utils/src/com/cloud/utils/cisco/n1kv/vsm/VsmCommand.java b/utils/src/com/cloud/utils/cisco/n1kv/vsm/VsmCommand.java index 444e6e07938..d510d6d0676 100644 --- a/utils/src/com/cloud/utils/cisco/n1kv/vsm/VsmCommand.java +++ b/utils/src/com/cloud/utils/cisco/n1kv/vsm/VsmCommand.java @@ -79,10 +79,10 @@ public class VsmCommand { return serialize(domImpl, doc); } catch (ParserConfigurationException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating add port profile message : " + e.getMessage()); return null; } catch (DOMException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating add port profile message : " + e.getMessage()); return null; } } @@ -113,10 +113,10 @@ public class VsmCommand { return serialize(domImpl, doc); } catch (ParserConfigurationException e) { - s_logger.error("Error while creating update message : " + e.getMessage()); + s_logger.error("Error while creating update port profile message : " + e.getMessage()); return null; } catch (DOMException e) { - s_logger.error("Error while creating update message : " + e.getMessage()); + s_logger.error("Error while creating update port profile message : " + e.getMessage()); return null; } } @@ -146,15 +146,15 @@ public class VsmCommand { return serialize(domImpl, doc); } catch (ParserConfigurationException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating delete port profile message : " + e.getMessage()); return null; } catch (DOMException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating delete port profile message : " + e.getMessage()); return null; } } - public static String getPolicyMap(String name, int averageRate, int maxRate, int burstRate) { + public static String getAddPolicyMap(String name, int averageRate, int maxRate, int burstRate) { try { // Create the document and root element. DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); @@ -179,10 +179,10 @@ public class VsmCommand { return serialize(domImpl, doc); } catch (ParserConfigurationException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating policy map message : " + e.getMessage()); return null; } catch (DOMException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating policy map message : " + e.getMessage()); return null; } } @@ -212,10 +212,10 @@ public class VsmCommand { return serialize(domImpl, doc); } catch (ParserConfigurationException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating delete policy map message : " + e.getMessage()); return null; } catch (DOMException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating delete policy map message : " + e.getMessage()); return null; } } @@ -245,10 +245,10 @@ public class VsmCommand { return serialize(domImpl, doc); } catch (ParserConfigurationException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating attach/detach service policy message : " + e.getMessage()); return null; } catch (DOMException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating attach/detach service policy message : " + e.getMessage()); return null; } } @@ -282,10 +282,43 @@ public class VsmCommand { return serialize(domImpl, doc); } catch (ParserConfigurationException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating the message to get port profile details: " + e.getMessage()); return null; } catch (DOMException e) { - s_logger.error("Error while creating delete message : " + e.getMessage()); + s_logger.error("Error while creating the message to get port profile details: " + e.getMessage()); + return null; + } + } + + public static String getPolicyMap(String name) { + try { + DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); + DOMImplementation domImpl = docBuilder.getDOMImplementation(); + Document doc = createDocument(domImpl); + + Element get = doc.createElement("nf:get"); + doc.getDocumentElement().appendChild(get); + + Element filter = doc.createElement("nf:filter"); + filter.setAttribute("type", "subtree"); + get.appendChild(filter); + + // Create the show port-profile name