Package org.jclouds.ec2.domain

Examples of org.jclouds.ec2.domain.Subnet


   private Set<RunningInstance> createKeyPairAndSecurityGroupsAsNeededThenRunInstances(String group, int count,
         Template template) {
      String region = AWSUtils.getRegionFromLocationOrNull(template.getLocation());
      String zone = getZoneFromLocationOrNull(template.getLocation());
      RunInstancesOptions instanceOptions = createKeyPairAndSecurityGroupsAsNeededAndReturncustomize.execute(region,
            group, template);
      return createNodesInRegionAndZone(region, zone, group, count, template, instanceOptions);
   }
View Full Code Here


         Set<SecurityGroup> oneResult = client.describeSecurityGroupsInRegion(null, group1Name);
         assertNotNull(oneResult);
         assertEquals(oneResult.size(), 1);
         final SecurityGroup group = oneResult.iterator().next();
         assertEquals(group.getName(), group1Name);
         IpPermissions group2CanHttpGroup1 = IpPermissions.permit(IpProtocol.TCP).port(80)
               .originatingFromSecurityGroupId(group1Id);
         AWSSecurityGroupClient.class.cast(client).authorizeSecurityGroupIngressInRegion(null, group2Id,
               group2CanHttpGroup1);
         assertEventually(new GroupHasPermission(client, group2Name, new Predicate<IpPermission>() {
            @Override
View Full Code Here

         client.getTagApiForRegion(region).get().applyToResources(common, ids);
         for (NodeMetadata in : input)
            builder.add(addTagsForInstance(common, in));
      }
      if (logger.isDebugEnabled()) {
         Multimap<String, String> filter = new TagFilterBuilder().resourceIds(instancesById.keySet()).build();
         FluentIterable<Tag> tags = client.getTagApiForRegion(region).get().filter(filter);
         logger.debug("<< applied tags in region %s: %s", region, resourceToTagsAsMap(tags));
      }
      return builder.build();
   }
View Full Code Here

               .append("<DescribeRegionsResponse xmlns=\"http://ec2.amazonaws.com/doc/2010-06-15/\"><requestId>0a5a6b4d-c0d7-4531-9ba9-bbc0b94d2007</requestId><regionInfo><item><regionName>is-1</regionName><regionEndpoint>api.greenqloud.com</regionEndpoint></item></regionInfo></DescribeRegionsResponse>\n")
               .toString();

      Map<String, URI> expected = expected();

      DescribeRegionsResponseHandler handler = injector.getInstance(DescribeRegionsResponseHandler.class);
      Map<String, URI> result = factory.create(handler).parse(text);

      assertEquals(result.toString(), expected.toString());

   }
View Full Code Here

      try {
         NeutronApi neutronApi = api(server.getUrl("/").toString(), "openstack-neutron", overrides);
         SubnetApi api = neutronApi.getSubnetApi("RegionOne");

         Subnet subnet = api.get("12345");

         /*
          * Check request
          */
         assertEquals(server.getRequestCount(), 2);
View Full Code Here

         Subnet.UpdateOptions updateSubnet = Subnet.updateOptions()
               .name("new_name")
               .gatewayIp("10.0.3.254")
               .build();

         Subnet subnet = api.update("12345", updateSubnet);

         /*
          * Check request
          */
         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "PUT", "/v2.0/subnets/12345", "/subnet_update_request.json");

         /*
          * Check response
          */
         assertNotNull(subnet);
         assertEquals(subnet.getName(), "new_name");
         assertEquals(subnet.getId(), "9436e561-47bf-436a-b1f1-fe23a926e031");
         assertEquals(subnet.getTenantId(), "c1210485b2424d48804aad5d39c61b8f");
      } finally {
         server.shutdown();
      }
   }
View Full Code Here

         Subnet.UpdateOptions updateSubnet = Subnet.updateOptions()
               .name("new_name")
               .gatewayIp("10.0.3.254")
               .build();

         Subnet subnet = api.update("12345", updateSubnet);

         /*
          * Check request
          */
         assertEquals(server.getRequestCount(), 2);
View Full Code Here

         Subnet.CreateOptions createSubnet = Subnet.createOptions("1234567890", "10.0.3.0/24")
               .name("jclouds-wibble")
               .ipVersion(4)
               .build();

         Subnet subnet = api.create(createSubnet);

         /*
          * Check request
          */
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "POST", "/v2.0/subnets", "/subnet_create_request.json");

         /*
          * Check response
          */
         assertNotNull(subnet);
         assertEquals(subnet.getName(), "jclouds-wibble");
         assertEquals(subnet.getIpVersion().intValue(), 4);
         assertEquals(subnet.getCidr(), "10.0.3.0/24");
         assertEquals(subnet.getTenantId(), "1234567890");
         assertEquals(subnet.getId(), "624312ff-d14b-4ba3-9834-1c78d23d574d");
      } finally {
         server.shutdown();
      }
   }
View Full Code Here

         Subnet.CreateOptions createSubnet = Subnet.createOptions("1234567890", "cidr")
               .name("jclouds-wibble")
               .ipVersion(4)
               .build();

         Subnet subnet = api.create(createSubnet);
      } finally {
         server.shutdown();
      }
   }
View Full Code Here

      try {
         NeutronApi neutronApi = api(server.getUrl("/").toString(), "openstack-neutron", overrides);
         SubnetApi api = neutronApi.getSubnetApi("RegionOne");

         Subnet subnet = api.get("12345");

         /*
          * Check request
          */
         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "GET", "/v2.0/subnets/12345");

         /*
          * Check response
          */
         assertNotNull(subnet);
         assertEquals(subnet.getName(), "jclouds-wibble");
         assertEquals(subnet.getId(), "624312ff-d14b-4ba3-9834-1c78d23d574d");
         assertEquals(subnet.getTenantId(), "1234567890");
         assertEquals(subnet.getIPv6AddressMode(), IPv6DHCPMode.SLAAC);
      } finally {
         server.shutdown();
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.ec2.domain.Subnet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.