jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Turli <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
Date Thu, 02 Aug 2018 11:58:53 GMT
andreaturli commented on this pull request.



> +
+      String securityGroupId = null;
+      if (!options.getGroups().isEmpty()) {
+         Iterable<String> securityGroupNames = api.securityGroupApi().list(location.getId()).concat().transform(new
Function<SecurityGroup, String>() {
+            @Override
+            public String apply(SecurityGroup input) {
+               return input.name();
+            }
+         });
+         for (String securityGroupName : options.getGroups()) {
+            checkState(Iterables.contains(securityGroupNames, securityGroupName), "Cannot
find security group with name " + securityGroupName + ". \nSecurity groups available are:
\n" + Iterables.toString(securityGroupNames)); // {
+         }
+      } else if (options.getInboundPorts().length > 0) {
+         String name = namingConvention.create().sharedNameForGroup(group);
+         SecurityGroupRequest securityGroupRequest = api.securityGroupApi().create(location.getId(),
+                 CreateSecurityGroupOptions.Builder.securityGroupName(name).vpcId(options.getVpcId()));

ok for validating them, not entirely sure about create a vSwitch if not available

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207199172
Mime
View raw message