Examples of CreateServerOptions


Examples of org.jclouds.glesys.options.CreateServerOptions

                       .addFormParam("transfer", "50")
                       .addFormParam("ip", "10.0.0.1")
                       .addFormParam("description", "Description-of-server").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/server_details.json")).build()).getServerApi();

      CreateServerOptions options = CreateServerOptions.Builder.description("Description-of-server").ip("10.0.0.1");


      assertEquals(api.createWithHostnameAndRootPassword(ServerSpec.builder().datacenter("Falkenberg")
            .platform("OpenVZ").templateName("Ubuntu 32-bit").diskSizeGB(5).memorySizeMB(512).cpuCores(1).transferGB(50)
            .build(), "jclouds-test", "password", options), expectedServerDetails());
View Full Code Here

Examples of org.jclouds.glesys.options.CreateServerOptions

      checkArgument(template.getOptions().getClass().isAssignableFrom(GleSYSTemplateOptions.class),
            "options class %s should have been assignable from GleSYSTemplateOptions", template.getOptions().getClass());

      GleSYSTemplateOptions templateOptions = template.getOptions().as(GleSYSTemplateOptions.class);

      CreateServerOptions createServerOptions = new CreateServerOptions();
      createServerOptions.ip(templateOptions.getIp());

      Map<String, String> md = metadataAndTagsAsCommaDelimitedValue(template.getOptions());
      if (md.size() > 0) {
         String description = Joiner.on('\n').withKeyValueSeparator("=").join(md);
         // TODO: get glesys to stop stripping out equals and commas!
         createServerOptions.description(base16().lowerCase().encode(description.getBytes(UTF_8)));
      }
      ServerSpec.Builder<?> builder = ServerSpec.builder();
      builder.datacenter(template.getLocation().getId());
      builder.templateName(template.getImage().getId());
      builder.platform(template.getHardware().getHypervisor());
View Full Code Here

Examples of org.jclouds.glesys.options.CreateServerOptions

                       .addFormParam("transfer", "50")
                       .addFormParam("ip", "10.0.0.1")
                       .addFormParam("description", "Description-of-server").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/server_details.json")).build()).getServerApi();

      CreateServerOptions options = CreateServerOptions.Builder.description("Description-of-server").ip("10.0.0.1");


      assertEquals(api.createWithHostnameAndRootPassword(ServerSpec.builder().datacenter("Falkenberg")
            .platform("OpenVZ").templateName("Ubuntu 32-bit").diskSizeGB(5).memorySizeMB(512).cpuCores(1).transferGB(50)
            .build(), "jclouds-test", "password", options), expectedServerDetails());
View Full Code Here

Examples of org.jclouds.glesys.options.CreateServerOptions

      checkArgument(template.getOptions().getClass().isAssignableFrom(GleSYSTemplateOptions.class),
            "options class %s should have been assignable from GleSYSTemplateOptions", template.getOptions().getClass());

      GleSYSTemplateOptions templateOptions = template.getOptions().as(GleSYSTemplateOptions.class);

      CreateServerOptions createServerOptions = new CreateServerOptions();
      createServerOptions.ip(templateOptions.getIp());
      template.getOptions().userMetadata(ComputeServiceConstants.NODE_GROUP_KEY, group);

      Map<String, String> md = metadataAndTagsAsCommaDelimitedValue(template.getOptions());
      if (md.size() > 0) {
         String description = Joiner.on('\n').withKeyValueSeparator("=").join(md);
         // TODO: get glesys to stop stripping out equals and commas!
         createServerOptions.description(base16().lowerCase().encode(description.getBytes(UTF_8)));
      }
      ServerSpec.Builder<?> builder = ServerSpec.builder();
      builder.datacenter(template.getLocation().getId());
      builder.templateName(template.getImage().getId());
      builder.platform(template.getHardware().getHypervisor());
View Full Code Here

Examples of org.jclouds.glesys.options.CreateServerOptions

      checkArgument(template.getOptions().getClass().isAssignableFrom(GleSYSTemplateOptions.class),
            "options class %s should have been assignable from GleSYSTemplateOptions", template.getOptions().getClass());

      GleSYSTemplateOptions templateOptions = template.getOptions().as(GleSYSTemplateOptions.class);

      CreateServerOptions createServerOptions = new CreateServerOptions();
      createServerOptions.ip(templateOptions.getIp());
      template.getOptions().userMetadata(ComputeServiceConstants.NODE_GROUP_KEY, group);

      Map<String, String> md = metadataAndTagsAsCommaDelimitedValue(template.getOptions());
      if (md.size() > 0) {
         String description = Joiner.on('\n').withKeyValueSeparator("=").join(md);
         // TODO: get glesys to stop stripping out equals and commas!
         createServerOptions.description(base16().lowerCase().encode(description.getBytes(UTF_8)));
      }
      ServerSpec.Builder<?> builder = ServerSpec.builder();
      builder.datacenter(template.getLocation().getId());
      builder.templateName(template.getImage().getId());
      builder.platform(template.getHardware().getHypervisor());
View Full Code Here

Examples of org.jclouds.glesys.options.CreateServerOptions

      checkArgument(template.getOptions().getClass().isAssignableFrom(GleSYSTemplateOptions.class),
            "options class %s should have been assignable from GleSYSTemplateOptions", template.getOptions().getClass());

      GleSYSTemplateOptions templateOptions = template.getOptions().as(GleSYSTemplateOptions.class);

      CreateServerOptions createServerOptions = new CreateServerOptions();
      createServerOptions.ip(templateOptions.getIp());

      Map<String, String> md = metadataAndTagsAsCommaDelimitedValue(template.getOptions());
      if (md.size() > 0) {
         String description = Joiner.on('\n').withKeyValueSeparator("=").join(md);
         // TODO: get glesys to stop stripping out equals and commas!
         createServerOptions.description(base16().lowerCase().encode(description.getBytes(UTF_8)));
      }
      ServerSpec.Builder<?> builder = ServerSpec.builder();
      builder.datacenter(template.getLocation().getId());
      builder.templateName(template.getImage().getId());
      builder.platform(template.getHardware().getHypervisor());
View Full Code Here

Examples of org.jclouds.glesys.options.CreateServerOptions

                       .addFormParam("transfer", "50")
                       .addFormParam("ip", "10.0.0.1")
                       .addFormParam("description", "Description-of-server").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/server_details.json")).build()).getServerApi();

      CreateServerOptions options = CreateServerOptions.Builder.description("Description-of-server").ip("10.0.0.1");


      assertEquals(api.createWithHostnameAndRootPassword(ServerSpec.builder().datacenter("Falkenberg")
            .platform("OpenVZ").templateName("Ubuntu 32-bit").diskSizeGB(5).memorySizeMB(512).cpuCores(1).transferGB(50)
            .build(), "jclouds-test", "password", options), expectedServerDetails());
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

            Template template) {

      LoginCredentials.Builder credentialsBuilder = LoginCredentials.builder();
      NovaTemplateOptions templateOptions = template.getOptions().as(NovaTemplateOptions.class);

      CreateServerOptions options = new CreateServerOptions();
      options.metadata(metadataAndTagsAsCommaDelimitedValue(template.getOptions()));
      if (templateOptions.getSecurityGroupNames().isPresent())
         options.securityGroupNames(templateOptions.getSecurityGroupNames().get());
      options.userData(templateOptions.getUserData());
      options.diskConfig(templateOptions.getDiskConfig());

      Optional<String> privateKey = Optional.absent();
      if (templateOptions.getKeyPairName() != null) {
         options.keyPairName(templateOptions.getKeyPairName());       
         KeyPair keyPair = keyPairCache.getIfPresent(ZoneAndName.fromZoneAndName(template.getLocation().getId(), templateOptions.getKeyPairName()));
         if (keyPair != null && keyPair.getPrivateKey() != null) {
            privateKey = Optional.of(keyPair.getPrivateKey());
            credentialsBuilder.privateKey(privateKey.get());
         }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

   public void testCreateWithNetworkOptions() {
      String serverId = null;
      for (String zoneId : zones) {
         ServerApi serverApi = api.getServerApiForZone(zoneId);
         try {
            CreateServerOptions options = CreateServerOptions.Builder.novaNetworks(
                  // This network UUID must match an existing network.
                  ImmutableSet.of(Network.builder().networkUuid("bc4cfa2b-2b27-4671-8e8f-73009623def0").fixedIp("192.168.55.56").build())
                  );
            ServerCreated server = serverApi.create(hostName, imageIdForZone(zoneId), "1", options);
            serverId = server.getId();
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

   }

   private Server createServer(String zoneId, String availabilityZoneId) {
      ServerApi serverApi = api.getServerApiForZone(zoneId);

      CreateServerOptions options = new CreateServerOptions();
      if (availabilityZoneId != null) {
          options = options.availabilityZone(availabilityZoneId);
      }

      ServerCreated server = serverApi.create(hostName, imageIdForZone(zoneId), flavorRefForZone(zoneId), options);

      awaitActive(serverApi).apply(server.getId());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.