Package org.jclouds.openstack.nova.v2_0.domain.regionscoped

Examples of org.jclouds.openstack.nova.v2_0.domain.regionscoped.ServerInRegion


      return props;
   }
  
   protected Server createServerInZone(String zoneId) {
      ServerApi serverApi = api.getServerApiForZone(zoneId);
      ServerCreated server = serverApi.create(hostName, imageIdForZone(zoneId), flavorRefForZone(zoneId));
      blockUntilServerInState(server.getId(), serverApi, Status.ACTIVE);
      return serverApi.get(server.getId());
   }
View Full Code Here


      ServerCreated lightweightServer = novaApi.getServerApi(regionId).create(name, imageId, flavorId, options);
      Server server = novaApi.getServerApi(regionId).get(lightweightServer.getId());

      logger.trace("<< server(%s)", server.getId());

      ServerInRegion serverInRegion = new ServerInRegion(server, regionId);
      if (!privateKey.isPresent() && lightweightServer.getAdminPass().isPresent())
         credentialsBuilder.password(lightweightServer.getAdminPass().get());
      return new NodeAndInitialCredentials<ServerInRegion>(serverInRegion, serverInRegion.slashEncode(), credentialsBuilder
               .build());
   }
View Full Code Here

         builder.addAll(novaApi.getServerApi(regionId).listInDetail().concat()
                  .transform(new Function<Server, ServerInRegion>() {

                     @Override
                     public ServerInRegion apply(Server arg0) {
                        return new ServerInRegion(arg0, regionId);
                     }

                  }));
      }
      return builder.build();
View Full Code Here

   @Override
   public ServerInRegion getNode(String id) {
      RegionAndId regionAndId = RegionAndId.fromSlashEncoded(id);
      Server server = novaApi.getServerApi(regionAndId.getRegion()).get(regionAndId.getId());
      return server == null ? null : new ServerInRegion(server, regionAndId.getRegion());
   }
View Full Code Here

   GroupNamingConvention.Factory namingConvention = Guice.createInjector().getInstance(GroupNamingConvention.Factory.class);

   @Test
   public void testWhenComputeServiceSaysAllNodesAreDeadBothGroupsAreReturned() {

      ServerInRegion withoutHost = new ServerInRegion(new ServerInRegionToNodeMetadataTest().expectedServer(), "az-1.region-a.geo-1");
      ServerInRegion withHost = new ServerInRegion(new ParseServerTest().expected(), "az-1.region-a.geo-1");

      ServerInRegionToNodeMetadata converter = new ServerInRegionToNodeMetadata(
               NovaComputeServiceContextModule.toPortableNodeStatus, locationIndex, Suppliers
               .<Set<? extends Image>> ofInstance(ImmutableSet.<Image> of()), Suppliers
               .<Set<? extends Hardware>> ofInstance(ImmutableSet.<Hardware> of()), namingConvention);
View Full Code Here

   }

   @Test
   public void testWhenComputeServiceSaysAllNodesAreDeadNoGroupsAreReturned() {

      ServerInRegion withoutHost = new ServerInRegion(new ServerInRegionToNodeMetadataTest().expectedServer(), "az-1.region-a.geo-1");
      ServerInRegion withHost = new ServerInRegion(new ParseServerTest().expected(), "az-1.region-a.geo-1");

      ServerInRegionToNodeMetadata converter = new ServerInRegionToNodeMetadata(
               NovaComputeServiceContextModule.toPortableNodeStatus, locationIndex, Suppliers
                        .<Set<? extends Image>> ofInstance(ImmutableSet.<Image> of()), Suppliers
                        .<Set<? extends Hardware>> ofInstance(ImmutableSet.<Hardware> of()), namingConvention);
View Full Code Here

      Server serverToConvert = new ParseServerTest().expected().toBuilder()
            .accessIPv4(null)
            .accessIPv6(null)
            .build();

      ServerInRegion serverInRegionToConvert = new ServerInRegion(serverToConvert, "az-1.region-a.geo-1");

      ServerInRegionToNodeMetadata converter = new ServerInRegionToNodeMetadata(
            NovaComputeServiceContextModule.toPortableNodeStatus, locationIndex, Suppliers
            .<Set<? extends Image>> ofInstance(images), Suppliers
            .<Set<? extends Hardware>> ofInstance(hardwares), namingConvention);
View Full Code Here

      Server serverToConvert = new ParseServerTest().expected().toBuilder()
            .accessIPv4("67.23.10.132")
            .accessIPv6("::babe:67.23.10.132")
            .build();

      ServerInRegion serverInRegionToConvert = new ServerInRegion(serverToConvert, "az-1.region-a.geo-1");

      ServerInRegionToNodeMetadata converter = new ServerInRegionToNodeMetadata(
            NovaComputeServiceContextModule.toPortableNodeStatus, locationIndex, Suppliers
            .<Set<? extends Image>> ofInstance(images), Suppliers
            .<Set<? extends Hardware>> ofInstance(hardwares), namingConvention);
View Full Code Here

      Server serverToConvert = new ParseServerTest().expected().toBuilder()
            .accessIPv4("76.32.1.231")
            .accessIPv6("::babe:76.32.1.231")
            .build();

      ServerInRegion serverInRegionToConvert = new ServerInRegion(serverToConvert, "az-1.region-a.geo-1");

      ServerInRegionToNodeMetadata converter = new ServerInRegionToNodeMetadata(
            NovaComputeServiceContextModule.toPortableNodeStatus, locationIndex, Suppliers
            .<Set<? extends Image>> ofInstance(images), Suppliers
            .<Set<? extends Hardware>> ofInstance(hardwares), namingConvention);
View Full Code Here

            .operatingSystem(OperatingSystem.builder().family(OsFamily.LINUX).description("foobuntu").build())
            .providerId("52415800-8b69-11e0-9b19-734f6f006e54").description("foobuntu").status(Image.Status.AVAILABLE)
            .location(region).build();

      Server serverToConvert = new ParseServerWithoutImageTest().expected();
      ServerInRegion serverInRegionToConvert = new ServerInRegion(serverToConvert, "az-1.region-a.geo-1");

      ServerInRegionToNodeMetadata converter = new ServerInRegionToNodeMetadata(
            NovaComputeServiceContextModule.toPortableNodeStatus, locationIndex,
            Suppliers.<Set<? extends Image>> ofInstance(ImmutableSet.of(existingImage)),
            Suppliers.<Set<? extends Hardware>> ofInstance(ImmutableSet.of(existingHardware)),
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.nova.v2_0.domain.regionscoped.ServerInRegion

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.