diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2InstanceFilterSet.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2InstanceFilterSet.java index d0a44de0e0b..29cdecda2b7 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2InstanceFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2InstanceFilterSet.java @@ -46,6 +46,7 @@ public class EC2InstanceFilterSet { filterTypes.put( "owner-id", "string" ); filterTypes.put( "root-device-name", "string" ); filterTypes.put( "private-ip-address", "string" ); + filterTypes.put( "group-id", "string" ); } @@ -154,6 +155,13 @@ public class EC2InstanceFilterSet { { return containsDevice( vm.getRootDeviceId(), valueSet ); } + else if (filterName.equalsIgnoreCase( "group-id")) + { + String[] groupSet = vm.getGroupSet(); + for (String group : groupSet) + if (containsString(group, valueSet)) return true; + return false; + } else return false; } 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